Getting the number of populated rows in a sheet

hallingh

Well-known Member
Joined
Sep 11, 2010
Messages
769
Hi all. This is a very easy question, and I've done this before, but I can't remember the exact coding and I'm somehow having trouble finding an example.

How do you get the number of populated rows in a given column? I know it's something like this:

Code:
Private Sub FindRows()
Dim RomNum As Long
RowNum = ActiveSheet.xlEndtoUp
MsgBox(RowNum)
 
End Sub


But I can't remember the exact coding. Thanks for the help!

Hank
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Try

Code:
Private Sub FindRows()
Dim RomNum As Long
RowNum = Range("A" & Rows.Count).End(xlUp).Row
MsgBox RowNum
End Sub
 
Upvote 0
Do you mean:
Rich (BB code):
Private Sub FindRows()
Dim RomNum As Long
RowNum = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
MsgBox(RowNum)
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top