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

Excel Macro - Go to next unused row 2

Status
Not open for further replies.
Feb 12, 2001
52
0
0
GB
I have data stored in individual rows with loads of conditional formatting . I am trying to write a macro that will take me to the first cell of the next empty row. "End(xlDown).Select" takes me to the last used cell, but how do I go down one more? Would appreciate some help on this. Thanks
 
mRow = Range("A1").end(xldown).row + 1
range("A" & mRow).select

I tend to use xlup tho

mRow = range("A65536").end(xlup).row + 1
range("A" & mRow).select

HTH Rgds
Geoff

Si hoc legere scis, nimis eruditionis habes
 
Alternatively, once you're at the last used cell, use the Offset() method to move down one row:
Selection.Offset(1,0).Select

Barborne
Worcester
UK
 
OR combine the above into one line

Code:
Range("a1").End(xlDown).Offset(1, 0).Select

Take heed of xlbo's comments re using xlUp though. This code will slect the next blank row, and is not much use if you have gaps in your data.

Happy Fiday
;-) If a man says something and there are no women there to hear him, is he still wrong?
 
Many thanks Geoff for your quick response - I decided to go for barborne and Loomah's solutions as they appeared easier. Thanks barborne and Loomah, it worked like a dream.

Laurence
Tewkesbury
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top