How to goto the next available cell in a column.

P

pmaths

Hi,

I'm pretty stuck with this.

In an Excel worksheet using VB I want to be able to goto the next
available cell in a column.

I've looked at / tried to butcher the following script which returns
the No of the row of the next blank cell in column A but I would like
it to activate this cell.

Sub FindLastCell()
Dim LastCell As Range
With ActiveSheet
Set LastCell = .Cells(.Rows.Count, "A").End(xlUp)
If IsEmpty(LastCell) Then
'do nothing
Else
Set LastCell = LastCell.Offset(1, 0)
End If
End With
MsgBox LastCell.Row
End Sub

Please - any advice would be gratefully received.

Cheers
 
G

Guest

Sub FindLastCell()
Dim LastCell As Range
With ActiveSheet
Set LastCell = .Cells(.Rows.Count, "A").End(xlUp)
If Not IsEmpty(LastCell) Then
Set LastCell = LastCell.Offset(1, 0)
End If
End With
MsgBox LastCell.Row
LastCell.Select
End Sub
 

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

Similar Threads


Top