Pinaceous
Well-known Member
- Joined
- Jun 11, 2014
- Messages
- 1,124
- Office Version
- 365
- Platform
- Windows
Good Day Everyone!
I'd like to create a sub where it can save the entire worksheet contents as a *.txt file.
I do have a sub now that seems to work but it is a work in progress.
Does anyone have any codes?
Many thanks,
Pinaceous
PS. This code does not work because it changes the worksheet name to
and I cannot seem to prevent this!
I'd like to create a sub where it can save the entire worksheet contents as a *.txt file.
I do have a sub now that seems to work but it is a work in progress.
Does anyone have any codes?
Many thanks,
Pinaceous
VBA Code:
Sub saveText()
ActiveWorkbook.SaveAs Filename:= _
ThisWorkbook.Path & "\textfile-" & Format(Now, "ddmmyy-hhmmss") & ".txt", FileFormat:=xlText, _
CreateBackup:=False
End Sub
PS. This code does not work because it changes the worksheet name to
VBA Code:
textfile-" & Format(Now, "ddmmyy-hhmmss")