danisham
asked on
Exporting individual Excel sheets to individual files
My supervisor was wondering when in a workbook, could you export the individual sheet to its own file? Instead of copying and pasting all of the values?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry...the copy/move was mentioned by mcOz...so only export to a new format if you want values but not formulas.
ASKER
Thanks McOz! I should have tried the obvious move / copy solution but didn't have time to fool around with the problem. May I ask where I would insert that code?
Sorry about the delay --
To insert the VBA code as a macro:
1. press Alt+F11 to open Microsoft Visual Basic
2. click Insert > Module
3. paste the attached code into the window that appears. This code will give the user a "Save as" box, so they can choose where to save and what to name the new file.
4. Save, and close Visual Basic
5. now you can assign this macro to a keyboard shortcut or button to run it.
McOz
To insert the VBA code as a macro:
1. press Alt+F11 to open Microsoft Visual Basic
2. click Insert > Module
3. paste the attached code into the window that appears. This code will give the user a "Save as" box, so they can choose where to save and what to name the new file.
4. Save, and close Visual Basic
5. now you can assign this macro to a keyboard shortcut or button to run it.
McOz
Sub SaveActiveSheet()
ActiveSheet.Move
fname = Application.GetSaveAsFilename("NewWorkbook", "Excel Files (*.xls), *.xls")
If fname <> False Then ActiveWorkbook.SaveAs Filename:=fname, FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
End Sub
If you want to move/copy the sheet, open the second workbook then in the first, right-click on the tabs at the bottom and and pick "Move or Copy", in the dropdown, pick the other workbook, then pick a place to move it to (for a copy, check the box at the bottom.)