How can I change the cell references in this code to be flexible for my requirement? This code finds the first used cell in a small range. I want to examine each group of cells and then move on to the next column [cols I to N]
I want to use StartRow, EndRow and c to identify the columns and each small range of cells in the column---the number of rows varies something like this
Sadly my effort doesn't work Can I use the cell references with the CountA?
VBA Code:
With ActiveSheet
If WorksheetFunction.CountA(Range("K2:K12")) = 0 Then
MsgBox "empty space"
Exit Sub
Else
MsgBox "Cell with value is row " & Range("K2:K12").Find(What:="*", After:=Range("K2")).Row
End If
End With
I want to use StartRow, EndRow and c to identify the columns and each small range of cells in the column---the number of rows varies something like this
VBA Code:
With ActiveSheet
If WorksheetFunction.CountA("Range(cells(startrow,c)):Range(cells(endrow,c))") = 0 Then 'if entire range is null then exit
Exit Sub
Else
MsgBox "Cell with value is row " & ((Cells(StartRow, c): Cells(EndRow, c)).Find(What:="*", After:=Cells(StartRow, c)).Row
End If
End With
Sadly my effort doesn't work Can I use the cell references with the CountA?