Hi,
I am not sure how to do this. I have code that is exporting a spreadsheet as a CSV file, but I would like to name the file based on information in Cell J2 on a spreadsheet within the workbook called Int_Check. Can you please help me modify the code to rename the exported file. I would like if possible the spreadsheet to stay "20" in the file. But if that is difficult I can work around this.
Thank you so much for your help
Dim csvFile As String
Dim wsName As Variant
'Dim OutApp As Object, OutMail As Object
Sheets("20").Activate
wsName = ActiveSheet.Name
csvFile = ThisWorkbook.Path & "\" & wsName & ".csv"
ThisWorkbook.ActiveSheet.Copy
ActiveWorkbook.SaveAs csvFile, FileFormat:=xlCSV
ActiveWorkbook.Close False
I am not sure how to do this. I have code that is exporting a spreadsheet as a CSV file, but I would like to name the file based on information in Cell J2 on a spreadsheet within the workbook called Int_Check. Can you please help me modify the code to rename the exported file. I would like if possible the spreadsheet to stay "20" in the file. But if that is difficult I can work around this.
Thank you so much for your help
Dim csvFile As String
Dim wsName As Variant
'Dim OutApp As Object, OutMail As Object
Sheets("20").Activate
wsName = ActiveSheet.Name
csvFile = ThisWorkbook.Path & "\" & wsName & ".csv"
ThisWorkbook.ActiveSheet.Copy
ActiveWorkbook.SaveAs csvFile, FileFormat:=xlCSV
ActiveWorkbook.Close False