hi,
want to get Min and Max value ignoring blank cells,
the code bellow not works,
want to get Min and Max value ignoring blank cells,
the code bellow not works,
VBA Code:
Sub Makro5()
'
Dim rng As Range
Dim sht As Worksheet
Dim lastrow As Long
Set sht = ThisWorkbook.Worksheets("Sheet1")
lastrow = sht.Cells(sht.Rows.Count, "B").End(xlUp).Row '
For i = 2 To lastrow
Set rng = Range("AG" & i & ",AI" & i)
sht.Range("AP" & i).Value = Application.WorksheetFunction.Min(rng)
sht.Range("AQ" & i).Value = Application.WorksheetFunction.Max(rng)
Next i
End Sub