Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL -- text file name

Status
Not open for further replies.

wuwang

Programmer
May 16, 2001
48
US
Hi,


I want to write data from EXCEL to a text file.
I would like to have the file name like
Update_testfile3_systemtime.txt

I used:
Open ThisWorkbook.Path & "\Update_testfile3.txt" & systemtime & ".txt" For Output As #1

Do you have idea that which function I can use for adding systemtime (EASTERN time)in file name?

Thanks

 
Hi wuwang,
You probably want to be posting question like this in the VBA Visual Basic for
Applications (Microsoft) Forum.
But to answer your question, Now is a Date/Time function that returns the current Date & Time.
Code:
Open ThisWorkbook.Path & "\Update_testfile3.txt" & Now - Int(Now) & ".txt"
                         For Output As #1
Have at it -- :) Skip,
metzgsk@voughtaircraft.com
 
What's in a name?

Everything but...colons and dots...beware, beware! LOL It's better to have two heads to solve a problem from different angles than to have tunnel vision to a dead end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top