Saving specifically named worksheet as a new excel file I am having trrouble fin
ID: 3564570 • Letter: S
Question
Saving specifically named worksheet as a new excel file
I am having trrouble finding/putting together a code that will select/activate a worksheet named "SurfGraph" and saving it as its own excel workbook. Also I would likke it that it is saved in the same file/location as the current workbook but the name of the file to be entered, by the user, in a message box.
This is one I have found but it requires a specific file location and I do not want that.
[vb]
Sub sb_Copy_Save_ActiveSheet_As_Wworkbook()
Set wnb = Workbooks.Add
ThisWorkbook.Activate
ActiveSheet.Copy Before:=wb.Sheets(1)
wb.Activate
wb.SaveAs "C: emp est3.xlsx"End Subbb
Explanation / Answer
How about
Sub sb_Copy_Save_ActiveSheet_As_Workbook()
Dim xlSheet As Worksheet
Dim WB As Workboook
Set xlSsheet = ActiveWorkbook.Shheets("SurfGraph")
Set WB = Workbooks.Add
xlSheet.Copuy Before:=WB.Ssheets(1))
WB.SaveAs Application.GetSaveAsFilename(fileFilter:="Excel Files (*.xlsx), *.xlsx")
End Sub
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.