Hi,
Thanks for anyones help here,
I have a workbook with multiple (just two for now) name tabs / worksheets, I would like to save these individual tabs / worksheets as a separate file as a CSV, but I would like to call each CSV as
text + tab name + date
so eg - Test 1_Test_2_SSS1-CHF-22.08.22
Hers the code I have but, its causes errors, seems to be an issue when I introduced the SName & DTE, can anyone help me get it working
Link for sharing test macro
Many thanks
Dave.
Sub Macro10()
'
' Macro10 Macro
Application.DisplayAlerts = False
Application.CutCopyMode = False 'Clearing the Office Clipboard
Application.ScreenUpdating = False ' This turns the screen updating off while the macro runs, helps with speed
Application.EnableEvents = False ' Disables events, so commands where you need to press OK
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'Create Temp Output file & remove redundant worksheets
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dim WB As Workbook
Dim WS As Worksheet
Dim FolderPath, FileName, SName, DTE As String
DTE = Format$(Now, " - dd.mm.yyyy")
FolderPath = "C::\Temp\test"
SName = "Test1_Test2_ "
For Each WS In Worksheets
WS.Copy
Set WB = ActiveWorkbook
SName = "Test1_Test2_ "
FileName = SName & WS.Name & DTE
WB.SaveAs FileName:=FolderPath & "\" & FileName, FileFormat:=xlCSV
Application.DisplayAlerts = False
WB.Close
Application.DisplayAlerts = True
Next WS
Application.DisplayAlerts = True
Application.CutCopyMode = False 'Clearing the Office Clipboard
Application.ScreenUpdating = True ' This turns the screen updating off while the macro runs, helps with speed
Application.EnableEvents = True ' Disables events, so commands where you need to press OK
End Sub
Thanks for anyones help here,
I have a workbook with multiple (just two for now) name tabs / worksheets, I would like to save these individual tabs / worksheets as a separate file as a CSV, but I would like to call each CSV as
text + tab name + date
so eg - Test 1_Test_2_SSS1-CHF-22.08.22
Hers the code I have but, its causes errors, seems to be an issue when I introduced the SName & DTE, can anyone help me get it working
Link for sharing test macro
Many thanks
Dave.
Sub Macro10()
'
' Macro10 Macro
Application.DisplayAlerts = False
Application.CutCopyMode = False 'Clearing the Office Clipboard
Application.ScreenUpdating = False ' This turns the screen updating off while the macro runs, helps with speed
Application.EnableEvents = False ' Disables events, so commands where you need to press OK
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'Create Temp Output file & remove redundant worksheets
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dim WB As Workbook
Dim WS As Worksheet
Dim FolderPath, FileName, SName, DTE As String
DTE = Format$(Now, " - dd.mm.yyyy")
FolderPath = "C::\Temp\test"
SName = "Test1_Test2_ "
For Each WS In Worksheets
WS.Copy
Set WB = ActiveWorkbook
SName = "Test1_Test2_ "
FileName = SName & WS.Name & DTE
WB.SaveAs FileName:=FolderPath & "\" & FileName, FileFormat:=xlCSV
Application.DisplayAlerts = False
WB.Close
Application.DisplayAlerts = True
Next WS
Application.DisplayAlerts = True
Application.CutCopyMode = False 'Clearing the Office Clipboard
Application.ScreenUpdating = True ' This turns the screen updating off while the macro runs, helps with speed
Application.EnableEvents = True ' Disables events, so commands where you need to press OK
End Sub