Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote