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

Move to Next Open Cell in Excel 4

Status
Not open for further replies.

jsaliers

Programmer
Jan 23, 2003
129
US
I have a macro, and I need it to move to the next open cell in column B in an excel worksheet. I have already selected cell B1, and the number of rows of data will vary, so it needs to find the next open cell in column B. Any ideas?

Thanks in advance!

Jon
 
hIYA

Try
Code:
Range("B1").End(xlDown).Offset(1,0).Select
That'll select the first empty cell found starting at cell B1

If you've got empty rows in your data & you want to select the first available empty row with no data beneath, you might be better off using
Code:
Range("B65536").End(xlUp).Offset(1,0).Select

HTH

Cheers
Nikki
 
One of these should help:



Sub ActivateNextBlankDown()
ActiveCell.Offset(1, 0).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
End Sub


'''''''''''''''''''''''''''''''''''''''''''''''''''
Sub ActivateNextBlankToRight()
ActiveCell.Offset(0, 1).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(0, 1).Select
Loop
End Sub
 
Really shouldn't use loops to find the next empty cell - they take sooooooooo loooooong - especially in comparison to the end(xlup) / usedrange / Find methods Rgds
Geoff

Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top