![]() |
How to use Open as Append for log file
I've snatched the following from exceltip.com but I can't figure out
how to get the date from my sheet, which will come from two different cells (user inputs data, results are calculated in two cells), into this macro for appending to the log file. I just can't figure out how it works... I think I'll need to copy the two (or possibly more) cells to the clipboard then paste to the log file, but I can't figure out how to do that. To summarize with the risk of sounding repetative, I want to take two cells in the same row and append the info to a log file. |
How to use Open as Append for log file
Something like this :
Private Sub CommandButton1_Click() Dim FF As Long FF = FreeFile Open "C:\TESTFILE" For Append As #FF Print #FF, Range("A1").Value & " & " & Range("B1").Value Close #1 End Sub NickHK "mike" wrote in message oups.com... I've snatched the following from exceltip.com but I can't figure out how to get the date from my sheet, which will come from two different cells (user inputs data, results are calculated in two cells), into this macro for appending to the log file. I just can't figure out how it works... I think I'll need to copy the two (or possibly more) cells to the clipboard then paste to the log file, but I can't figure out how to do that. To summarize with the risk of sounding repetative, I want to take two cells in the same row and append the info to a log file. |
How to use Open as Append for log file
NickHK wrote: Something like this : Private Sub CommandButton1_Click() Dim FF As Long FF = FreeFile Open "C:\TESTFILE" For Append As #FF Print #FF, Range("A1").Value & " & " & Range("B1").Value Close #1 End Sub NickHK Excellent. Thanks. |
All times are GMT +1. The time now is 09:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com