Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to create a macro that will save a worksheet as a text file when
I call the macro. So far I got it to save the worksheet as a text file, but I would like it to save as different files, instead of overwriting one file over and over. For instance when I edit the file everyday and I save it, I want it to be saved as a certain name, maybe todays date, the next day I would like it to save as the date for that day. Does anyone know how to do this? I recorded a macro below, tell me what you think: Sub Save_as() Application.ScreenUpdating = False Application.DisplayAlerts = False Sheets("ExportSheet").Select Dim myPath As String Dim myFile As String myPath = ActiveWorkbook.Path & "\" myFile = "import_file" myFile = myFile & ".txt" ActiveWorkbook.SaveAs Filename:=myPath & myFile, FileFormat:=xlText, CreateBackup:=False Sheets("Sheet1").Select Sheets("import_file").Name = "ExportSheet" Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem encountered when saving worksheet as a text file | Excel Worksheet Functions | |||
Saving a worksheet as . prn text file - record length | Excel Discussion (Misc queries) | |||
Saving worksheet in new file with date AND cell value as file name | Excel Discussion (Misc queries) | |||
Saving multi-tab excel file created from comma delimited text file | Excel Programming | |||
saving an excel file as an ASCII text file without delimiters | Excel Programming |