Thread: Time Stamp
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Time Stamp

Try:

Sub test()

Application.DisplayAlerts = False

With ActiveCell
.NumberFormat = "@"
.Value = Format(Now(), "yymmddhhmm")
End With

Application.DisplayAlerts = True

End Sub


RBS

"John Pierce" wrote in message
oups.com...
Thanks RB, that looks good, except for one itty-bitty problem.
In Excel 2003 it causes one of those usually-very-helpful
but sometimes-annoying error flags - in this case telling
me what I already know - that "The number in this cell is
formatted as text or is preceded by an apostrophe." Is
there anyway to programmatically prevent this, some
built-in error-checking. I tried recording the steps
involved in opening the message and selecting
"Ignore error" but nothing was recorded.