Hi,
I have 3 worksheets in a workbook. Spreadsheets named EXCEL, PDF and CSV in the TEMPLATE workbook. ( different details on each tab). I want to save off the Excel tab as its own excel workbook and the name based on the value in B1. I would like to save to the C Drive in a folder called Macro. The second step is the PDF spreadsheet as Name in Cell B2. I would like to save off the PDF tab to the same location and save as PDF. and similar on the 3rd tab save of as CSV also saved to the Macro folder. I have not created the name field yet but to make is easy say its cell B3.
Can you please help me with the code below. I am guessing once I have one step working the others will only need slight modifications.
VBA hates the Path field as well. And when I run it exports as excel and does not save anywhere. ( probably due to the error)
Any help is appreciated. Can an VBA master please help.
Dim name As String
Dim Path As String
Path = C:\MACRO
Name = Range("B2")
ActiveSpreadsheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=Path &Name& ".pdf"
I have 3 worksheets in a workbook. Spreadsheets named EXCEL, PDF and CSV in the TEMPLATE workbook. ( different details on each tab). I want to save off the Excel tab as its own excel workbook and the name based on the value in B1. I would like to save to the C Drive in a folder called Macro. The second step is the PDF spreadsheet as Name in Cell B2. I would like to save off the PDF tab to the same location and save as PDF. and similar on the 3rd tab save of as CSV also saved to the Macro folder. I have not created the name field yet but to make is easy say its cell B3.
Can you please help me with the code below. I am guessing once I have one step working the others will only need slight modifications.
VBA hates the Path field as well. And when I run it exports as excel and does not save anywhere. ( probably due to the error)
Any help is appreciated. Can an VBA master please help.
Dim name As String
Dim Path As String
Path = C:\MACRO
Name = Range("B2")
ActiveSpreadsheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=Path &Name& ".pdf"