Select next blank cell

R

rob nobel

I'm using the following to locate the next blank cell.
ActiveSheet.Range("G6000").End(xlUp).Offset(1, 0).Select
I find though, that if the cells have a formula in them that even if the
value is blank, this procedure thinks otherwise. How can this be amended to
ignore the formula, which is =IF(A37=TRUE,F37,) down the column.
Rob
 
D

Dave Peterson

Option Explicit
Sub testme()

Dim LastRow As Long
LastRow = ActiveSheet.Evaluate("=MAX(ROW(G1:G6000)*(G1:G6000<>""""))")

MsgBox LastRow & " Is the lastrow with something on it"

activesheet.cells(lastrow+1,"G").select

End Sub

You could also just loop through the cells looking for a cell that looks blank.
 
R

rob nobel

Another grat solution! Thanks Dave.
(And no extra charge for the message box? - cute.)
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top