So, (with some help, thx Si) I've successfully used the code below to create Text files from Excel's VBA. I have a new problem though.
How do I pass more than one line of text to the file?
Ideally I'ld like to be able to pass an ENTER keystroke(within "myString") and continue sText (myString) on a new line.
- Dim sFile As String
- Dim sText As String
- Dim iFileNum As Integer
- sFile = "C:\(path)\Textfile.txt"
- sText = "myString"
- iFileNum = FreeFile
- Open sFile For Output As iFileNum
- Print #iFileNum, sText
- Close #iFileNum