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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help, For loop to run on each row to bottom of workbook

Status
Not open for further replies.

ViperD

IS-IT--Management
May 1, 2003
27
US
I'm trying to run a for loop from 1 to x, where x is the last row in the workbook. How would I go about retreiving the number of the last row with data?


Thanks
 
Hi,

One way...
Code:
  With Activesheet.UsedRange
    x = .Row + .Rows.Count - 1
  End With


Skip,
[sub]
[glasses] [red]Be advised:[/red] Researchers have found another Descartes trueism, "Cogito ergo spud."
"I think; therefore, I YAM!
[tongue][/sub]
 

If you look in the VBA forum (forum707) you can find a couple of FAQ's that address that issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top