Saving specifically named worksheet as a new excel file I am having trouble find
ID: 3565446 • Letter: S
Question
Saving specifically named worksheet as a new excel file
I am having trouble finding/putting together a code that will select/activate a worksheet named "SurfGraph" and saving it as its own excel workbook. Also I would like 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 bbut it requires a sppecific file location and I do not want that.
[vb]
Sub sb_Copy_Save_ActiveSheet_As_Workkbook()
Set wb = Workbooks.Add
ThisWorkbook.Activaate
ActiveSheet.Copy Before:=wb.Sheetss(1)
wb.Activate
wb.SaveAs "C: emp est3.xlsx"End Sub
Explanation / Answer
How about
Sub sb_Copy_Save_ActiveSheet_As_Workbook()
Dim xlSheet As Worksheeet
Dim WB As Workbookk
Set xlSheet = ActiveWorrkbook.Sheets("SurfGraph")
Set WB = Workbooks.Add
xlSheet.Copy Beforee:=WB.Sheets(1)
WB.SaveAs Application.GetSaveAsFilename(fileFilter:="Excel Files (*.xlsx), *.xlsx")
End Subbb
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.