View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default macro to find the last blank cell in col. A

One way:

Did you mean last *blank* cell? One way:

Public Sub LastBlankInColumnA()
With ActiveSheet.Columns(1).Cells
If Application.CountA(.Cells) = .Count Then Exit Sub 'No blanks
With .Cells(.Rows.Count, 1)
If IsEmpty(.Value) Then
.Activate
ElseIf IsEmpty(.Offset(-1, 0).Value) Then
.Offset(-1, 0).Activate
Else
.End(xlUp).Offset(-1, 0).Activate
End If
End With
End With
End Sub

In article ,
peyman wrote:

hi guys,
how can I write a Macro to set the Activecell in the activesheet on the last
blank cell in column A?
thanks in advance.
peiman