Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function RecordEntry(r As Range)
- ' usage
- ' in the adjacent cell to your 'Name' column (e.g. cell B1) insert this Function
- ' = RecordEntry(A1)
- ' After you enter text Cell A1 it will get written to a text file Support.log along with the date and time
- Dim fso As New FileSystemObject
- ' Declare a TextStream.
- Dim stream As TextStream
- ' Create a TextStream.
- Set stream = fso.OpenTextFile("C:\temp\Support.log", ForAppending, True)
- For Each cell In r
- ' record the vale of the cell in the log file
- stream.Write cell.Text
- stream.Write " "
- Next
- ' write the current date and time
- stream.Write Now()
- ' new line
- stream.WriteBlankLines (1)
- stream.Close
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement