Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Row # of last row in UsedRange 1

Status
Not open for further replies.

rguglielmon

Technical User
Jan 6, 2003
12
0
0
US
How do I get the row number of the last row in a range returned by the UsedRange property of a Worksheet? In other words, what is the last row used in the sheet?

I have been using ActiveSheet.UsedRange.Rows.Count but just realized that this doesn't work if the worksheet does not use rows at the top.
 
hi,

Code:
With ActiveSheet.UsedRange
  FirstRow = .Row
  LastRow = Firstrow + .Rows.Count - 1
End with


Skip,
[sub]
[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top