Perhaps this will help
First of all paste this data into a worksheet , starting in A1 (contains several empty rows, the last row is row 13)
[TABLE="width: 384"]
<tbody>[TR]
[TD="class: xl63, width: 64"]Name[/TD]
[TD="class: xl63, width: 64"]HdrB[/TD]
[TD="class: xl63, width: 64"]HdrC[/TD]
[TD="class: xl63, width: 64"]HdrD[/TD]
[TD="class: xl63, width: 64"]HdrE[/TD]
[TD="class: xl63, width: 64"]HdrF[/TD]
[/TR]
[TR]
[TD="class: xl63"]name01[/TD]
[TD="class: xl63"]b1[/TD]
[TD="class: xl63"]c1[/TD]
[TD="class: xl63"]d1[/TD]
[TD="class: xl63"]e1[/TD]
[TD="class: xl63"]f1[/TD]
[/TR]
[TR]
[TD="class: xl63"]name02[/TD]
[TD="class: xl63"]b2[/TD]
[TD="class: xl63"]c2[/TD]
[TD="class: xl63"]d2[/TD]
[TD="class: xl63"]e2[/TD]
[TD="class: xl63"]f2[/TD]
[/TR]
[TR]
[TD="class: xl63"]name03[/TD]
[TD="class: xl63"]b3[/TD]
[TD="class: xl63"]c3[/TD]
[TD="class: xl63"]d3[/TD]
[TD="class: xl63"]e3[/TD]
[TD="class: xl63"]f3[/TD]
[/TR]
[TR]
[TD="class: xl63"]name04[/TD]
[TD="class: xl63"]b4[/TD]
[TD="class: xl63"]c4[/TD]
[TD="class: xl63"]d4[/TD]
[TD="class: xl63"]e4[/TD]
[TD="class: xl63"]f4[/TD]
[/TR]
[TR]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"]name05[/TD]
[TD="class: xl63"]b5[/TD]
[TD="class: xl63"]c5[/TD]
[TD="class: xl63"]d5[/TD]
[TD="class: xl63"]e5[/TD]
[TD="class: xl63"]f5[/TD]
[/TR]
[TR]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"]name06[/TD]
[TD="class: xl63"]b6[/TD]
[TD="class: xl63"]c6[/TD]
[TD="class: xl63"]d6[/TD]
[TD="class: xl63"]e6[/TD]
[TD="class: xl63"][/TD]
[/TR]
</tbody>[/TABLE]
and run this code with that sheet active
Code:
Sub SomeStats()
Dim rng As Range, fr As Long, lr As Long, rCount As Long, addr As String
With ActiveSheet
'using CurrentRegion (contiguous range)
Set rng = .Range("A1").CurrentRegion
addr = rng.Address(0, 0)
lr = rng(rng.Rows.Count, 1).Row
fr = rng(1, 1).Row
rCount = lr - fr + 1
rng.Select
MsgBox addr & vbTab & "Rowcount " & rCount, , "CurrentRegion"
'if you want to ignore headers
Set rng = .Range("A1").CurrentRegion
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1)
addr = rng.Address(0, 0)
lr = rng(rng.Rows.Count, 1).Row
fr = rng(1, 1).Row
rCount = lr - fr + 1
rng.Select
MsgBox addr & vbTab & "Rowcount " & rCount, , "CurrentRegion - excl headers"
'UsedRange
Set rng = .UsedRange
addr = rng.Address(0, 0)
lr = rng(rng.Rows.Count, 1).Row
fr = rng(1, 1).Row
rCount = lr - fr + 1
rng.Select
MsgBox addr & vbTab & "Rowcount " & rCount, , "UsedRange"
'using a column to determine
lr = .Range("F" & Rows.Count).End(xlUp).Row
Set rng = .Range("A2:H" & lr)
addr = rng.Address(0, 0)
fr = rng(1, 1).Row
rCount = lr - fr + 1
rng.Select
MsgBox addr & vbTab & "Rowcount " & rCount, , "Using a column"
End With
End Sub