View Single Post
  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Adding date to filename?

Or
Open "MyOutput" & Format(now, "dd-mm-yy_hh-mm-ss") & ".txt" For Output As #1

teepee wrote:

"teepee" wrote

However when I try

Open "MyOutput" & Format(Date, "yyyymmdd") & Format(Time, "hhmmss") &
".txt" For Output As #1

I get syntax error


Ah got it.

Open "MyOutput" & Format(Date, "dd-mm-yy") + "_" + Format(Time, "hh-mm-ss")
& ".txt" For Output As #1

Thanks for all your help

tp


--

Dave Peterson