Pinaceous
Well-known Member
- Joined
- Jun 11, 2014
- Messages
- 1,124
- Office Version
- 365
- Platform
- Windows
Good Day Everyone,
I'm exploring the possibility in producing text files, which capture data upon my Workbook, which produce a text file from a specified data range upon a Worksheet.
When I run this code upon a Worksheet it does produce the transfer of data.
However, it changes the Worksheet tab name to the same name as the exported text file.
Do you know how I can prevent this code from changing the Worksheet tab name upon my Workbook and where I can specify a range of the data for the proposed exported file?
Please let me know.
Thank you!
pinaceous
I'm exploring the possibility in producing text files, which capture data upon my Workbook, which produce a text file from a specified data range upon a Worksheet.
VBA Code:
Sub saveText()
ActiveWorkbook.SaveAs filename:= _
ThisWorkbook.Path & "\textfile-" & Format(Now, "ddmmyy-hhmmss") & ".txt", FileFormat:=xlText, _
CreateBackup:=False
End Sub
When I run this code upon a Worksheet it does produce the transfer of data.
However, it changes the Worksheet tab name to the same name as the exported text file.
Do you know how I can prevent this code from changing the Worksheet tab name upon my Workbook and where I can specify a range of the data for the proposed exported file?
Please let me know.
Thank you!
pinaceous