PDA

View Full Version : saving selected worksheets into new file



mccabe2017
05-10-2017, 07:22 PM
Trying to find code example. I want to copy selected worksheets into new file, without hard coding values. I saw one example but you had to name each worksheet in the module. I want it to be able to select worksheet then run module without having to update the code each time. Thanks in advance. -Kathryn

Paul_Hossler
05-10-2017, 07:32 PM
Try this. If Sheet1, Sheet2, and Sheet4 are selected, it will create a new WB with just those in it



Sub CopySelectedSheets()

ActiveWindow.SelectedSheets.Copy

End Sub