hearthhrob4gals
Board Regular
- Joined
- Aug 20, 2014
- Messages
- 142
Hi,
I want to create a text file. copy data from excel into it and display the text file...the below code creates a text file and pastes the data from excel. However, i cant see the text file open. i want the text file to be the active window. any help on this would be appreciated.
I want to create a text file. copy data from excel into it and display the text file...the below code creates a text file and pastes the data from excel. However, i cant see the text file open. i want the text file to be the active window. any help on this would be appreciated.
VBA Code:
Sub TextFile_Create()
Dim TextFile As Integer
Dim FilePath As String
FilePath = ActiveWorkbook.Path & "\AuditLog10.txt"
TextFile = FreeFile
Open FilePath For Output As TextFile
Print #TextFile, Sheets("Input").Range("dd1").Value
End Sub