Új hozzászólás Aktív témák

  • m.zmrzlina

    senior tag

    válasz m.zmrzlina #11728 üzenetére

    :Y

    Csak hogy ne maradjon az archívumban hülyeség kijavítatlanul, a makró helyesen:

    Sub min_max()
    Dim min As Single
    Dim max As Single
    Dim tipus As String
    Dim i As Integer

    For i = 1 To Range("A1048576").End(xlUp).Row

    Cells(i, 1).Select
    tipus = ActiveCell.Value
    min = ActiveCell.Offset(0, 1).Value
    max = ActiveCell.Offset(0, 1).Value

    If Application.WorksheetFunction.CountIf(Range("D:D"), tipus) = 0 Then
    Cells(1, 1).Select
    Do While ActiveCell.Value <> ""
    If ActiveCell.Value = tipus Then
    If ActiveCell.Offset(0, 1).Value < min Then
    min = ActiveCell.Offset(0, 1).Value
    ElseIf ActiveCell.Offset(0, 1).Value > max Then
    max = ActiveCell.Offset(0, 1).Value
    End If
    End If
    ActiveCell.Offset(1, 0).Select
    Loop

    Cells(Range("D1048576").End(xlUp).Row + 1, 4).Value = tipus
    Cells(Range("E1048576").End(xlUp).Row + 1, 5).Value = min
    Cells(Range("F1048576").End(xlUp).Row + 1, 6).Value = max

    End If

    Next

    End Sub

Új hozzászólás Aktív témák