Using CurrentRegion to count contiguous rows
If you're trying to count the number of rows in A2:Axx (until the gap), couldn't
you exclude the current region and do xldown like:
Dim myrange As Range
Dim myaddr As String
Dim ColumnRange As String
Dim ColumnCellNo As Long
ColumnRange = "A"
ColumnCellNo = 2
myaddr = ColumnRange & ColumnCellNo
Set myrange = Sheets(Table).Range(Range(myaddr), _
But you should add some checking to see if A2 and A3 are filled/empty, so the
xldown works ok.
If you're find the last cell used in column A, maybe something like:
set myrange = range("a2",cells(rows.count,"a").end(xlup))
> I'm using the following line of code to determine the number of rows in a
> ColumnRange = "A"
> ColumnCellNo = 2
> NRows = Sheets(Table).Range(ColumnRange & ColumnCellNo) _
> I only want it to count the rows in column A. Since column C has more
> rows of data, the above formula is returning the value for column C. How
> do I limit the formula to returning only the value for column A?
> Barney Byrd