torourke17
New Member
- Joined
- Jan 12, 2018
- Messages
- 12
- Office Version
- 365
- 2019
- Platform
- Windows
I use an 'Uploader' to take data from excel to interface and fill in fields in a program I use. My workbook contains several of these 'Uploaders' and the program requires the sheet to be named "Uploader". Obviously my workbook can't contain more than 1 sheet named "Uploader" so the vba below takes my existing "xyz Uploader" sheet and saves the cell values as a file, in a designated folder, and closes the new sheet that is created.
Before uploading this file to my program, I need to open the new sheet that was saved and change the sheet name from "xyz Uploader" to "Uploader"
I want to know if I can add something to the coding below to copy "xyz Uploader" out of my work book, changes the name of the sheet to "Uploader", save it in that designated folder, and close the new sheet after it has been created.
Thoughts?
Sub SaveSheet()
Sheets("xyz Uploader").Select
ActiveSheet.Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial xlValues
.PasteSpecial xlFormats
End With
Application.CutCopyMode = False
Dim Path As String
Path = "(Folder Location)"
ActiveWorkbook.SaveAs Path & ActiveSheet.Range("U7"), FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
Sheets("xyz Uploader").Select
End Sub
Before uploading this file to my program, I need to open the new sheet that was saved and change the sheet name from "xyz Uploader" to "Uploader"
I want to know if I can add something to the coding below to copy "xyz Uploader" out of my work book, changes the name of the sheet to "Uploader", save it in that designated folder, and close the new sheet after it has been created.
Thoughts?
Sub SaveSheet()
Sheets("xyz Uploader").Select
ActiveSheet.Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial xlValues
.PasteSpecial xlFormats
End With
Application.CutCopyMode = False
Dim Path As String
Path = "(Folder Location)"
ActiveWorkbook.SaveAs Path & ActiveSheet.Range("U7"), FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
Sheets("xyz Uploader").Select
End Sub