Thread: Excel Macros
View Single Post
  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default Excel Macros

Thanks Roger, but there is a also a logic error. Should be

Dim iLastRow as Long

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
If iLastRow = 1 And Cells(iLastRow,"A").Value = "" Then
'do nothing
Else
iLastRow = iLastRow + 1
End If
Cells(iLastRow,"A").Value = Format(Date,"dd mmm yyyy")


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Roger Govier" wrote in message
...
A couple of typos.
What Bob meant to type was

Dim iLastRow as Long

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
If iLastRow = 1 And Cells(iLastRow,"A").Value = "" Then
'do nothing
Else
iLastRow = iLastRow + 1
Cells(iLastRow,"A").Value = Format(Date,"dd mmm yyyy")
End If


Regards

Roger Govier


Bob Phillips wrote:
Dim iLastRow as Long

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
If iLastRow = 1 And Cells(iLastRow,"A").Value = "" Tyhen
'do nothing
Else
iLastRow = iLastRow + 1
Cells(iNextRow,"A").Value = Format(Date,"dd mmm yyyy")
End If