[VBA ] 請問輸出問題

看板Visual_Basic作者時間19年前 (2006/06/16 22:19), 編輯推噓2(201)
留言3則, 2人參與, 最新討論串1/2 (看更多)
Dim FileNo As Integer Dim CurrentLine As String Dim Filename As String Filename = "C:\Documents and Settings\data.txt" ' Define file name FileNo = FreeFile ' Establish free file handle Open Filename For Output As #FileNo ' Open file (writing mode) Print #FileNo, "This is a line of text" ' Save line Print #FileNo, "This is another line of text" ' Save line Close #FileNo ' Close file 請問我要如何才能讓data可以變成是一個變數呢?? 我想用now()函數把每天的檔案存進去~ 請問可行嗎??該怎麼做呢?? 請大家指導一下~~謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.135.251.190

06/17 08:07, , 1F
"C:\Documents and Settings\" & Now() & ".txt"
06/17 08:07, 1F

06/17 08:08, , 2F
Now() 出來的東西你還要改一下 因為有些符號不能當檔名
06/17 08:08, 2F

06/17 19:00, , 3F
Format(Now, "yyyymmdd")
06/17 19:00, 3F
文章代碼(AID): #14ahu2WZ (Visual_Basic)
討論串 (同標題文章)
以下文章回應了本文
完整討論串 (本文為第 1 之 2 篇):
文章代碼(AID): #14ahu2WZ (Visual_Basic)