PodliczDzien.rar

vba - poszukiwanie maksymalnej wartości sumy

Mała poprawka... Sub PodliczDzien() ActiveWorkbook.Worksheets("Arkusz1").Sort.SortFields.Clear ow = Cells(Rows.Count, "A").End(xlUp).Row ActiveWorkbook.Worksheets("Arkusz1").Sort.SortFields.Add Key:=Range(Cells(1, 1), Cells(ow, 1)) _ , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("Arkusz1").Sort .SetRange Range(Cells(1, 1), Cells(ow, 1)) .Header = xlGuess .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With Range("A1").Select Selection.AutoFilter ActiveWorkbook.Worksheets("Arkusz1").AutoFilter.Sort.SortFields.Clear ActiveWorkbook.Worksheets("Arkusz1").AutoFilter.Sort.SortFields.Add Key:= _ Range("B1:B17"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption _ :=xlSortNormal With ActiveWorkbook.Worksheets("Arkusz1").AutoFilter.Sort .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With MsgBox (Range("B2")) End Sub

  • PodliczDzien.rar
    • PodliczDzien.xlsm


Download file - link to post