I have multiple worksheets located in one file and I’d like to remove or copy each worksheet from the one file into their own separate files. For example file.xls has 5 worksheets named sheet1, sheet2, sheet3, sheet4 and sheet5. I’d like sheet1 to be saved to a new file called file1.xls, and sheet2 to a new file called file2.xls… etc.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Saving worksheets to separate files (Excel 97)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Saving worksheets to separate files (Excel 97)
- This topic has 21 replies, 8 voices, and was last updated 19 years ago.
Viewing 1 reply threadAuthorReplies-
WSladygnome
AskWoody LoungerAugust 28, 2003 at 8:45 pm #707188Well, my solution isn’t exactly elegant, but what I usually do is simply highlight the entire worksheet by clicking in the upper left corner, right click -select copy. Then create a new workbook and paste the copied sheet in. Then save it as whatever name I like.
I’m fascinated to see how this can be done more quickly and “professionally”. -
WSLJM
AskWoody LoungerAugust 28, 2003 at 9:12 pm #707192Thank you for your reply, however I should have worded my question a bit differently, as I have about 30 worksheets that I want to save to 30 different files, and I was wondering if there was a fast and quick way to do so without having to do the copy and paste and save as… thanks anyway… I was thinking maybe there was a macro out there or something.
-
WSErrolv
AskWoody LoungerAugust 28, 2003 at 11:34 pm #707296LJM,
I put this little ditty together:Sub Breakout()
‘
‘ BreakOut Macro
‘ removes all worksheets, leaving worksheet #1
‘ All worksheets saved to active directory in their own name.
‘
Dim ShHome As String
ShHome = ActiveSheet.NameFor Each Worksheet In Worksheets
Worksheets(2).Move
ActiveWorkbook.SaveAs (ActiveSheet.Name & “.xls”)
ActiveWorkbook.Close
Next Worksheet
End SubIt does nothing with the first worksheet in the bunch, but you can save that outside the loop if you want.
[Added after first posting:}
The ShHome variable can help you recognize the “main” worksheet, and prevent it form being moved out, as
If activeworksheet.name=ShHome then exit subErrol
-
WSLJM
AskWoody LoungerAugust 29, 2003 at 2:37 pm #707644Thank you, Thank you! That macro worked perfectly!
Now to complicate things a bit more… before saving all the worksheets to their own files, can I have the macro look at each worksheet and adjust the column to width automatically, and do a copy paste special values for each worksheet?
What we have is an ADP download of peoples vacation and flex balances, and we want to email each supervisor their employees vac & flex balances. I’ve used the download from ADP to make a pivot table, I then did a “show pages” function based on the supervisor’s name… this creates the 30 or so worksheets I mentioned in the first request. Since I don’t want everyone to see everyone elses balances I want to copy paste values so the pivot table is no longer a pivot table, plus I want the column widths to be adjusted as well, as some peoples names are longer than others.
Last but not least (I’m having doubt about this one) is there a way to have these newly created files attached to separate emails, going to the correct person based on the file name (the worksheets, and then the new file names based on the worksheet name are the supervisor names). We use lotus notes release 6.
Anyone got any ideas?!?!?!
Thanks so much!!!!!
-
WSErrolv
AskWoody LoungerAugust 29, 2003 at 11:28 pm #707923LJM,
For your next two wishes….I learned lots of stuff by this method:
1. Click on Tools|Macros|Record New Macro
2. Choose to store the new macro in a new workbook (to protect the integrity of your original files)
3. Then do your thing. In this case, select/copy/paste special(values). Select the columns you want to resize, double-click on the column dividers (up near the ABC’s). Then stop the maco.
4. Open the Macro editor to see your new program. There’s the commands you’ll need.The automatic macro often adds extra commands, but you should be able to figure out what you need.
Seriously, if this just doesn’t stick in your head, or you’d rather learn Senegalese than VBA, let me know. These two things are simple enough to do.
As for the email thing, I bet it can happen, but I’ve never worked on that type of program.
Errol
-
WSErrolv
AskWoody LoungerAugust 29, 2003 at 11:28 pm #707924LJM,
For your next two wishes….I learned lots of stuff by this method:
1. Click on Tools|Macros|Record New Macro
2. Choose to store the new macro in a new workbook (to protect the integrity of your original files)
3. Then do your thing. In this case, select/copy/paste special(values). Select the columns you want to resize, double-click on the column dividers (up near the ABC’s). Then stop the maco.
4. Open the Macro editor to see your new program. There’s the commands you’ll need.The automatic macro often adds extra commands, but you should be able to figure out what you need.
Seriously, if this just doesn’t stick in your head, or you’d rather learn Senegalese than VBA, let me know. These two things are simple enough to do.
As for the email thing, I bet it can happen, but I’ve never worked on that type of program.
Errol
-
-
-
WSLJM
AskWoody LoungerAugust 29, 2003 at 2:37 pm #707645Thank you, Thank you! That macro worked perfectly!
Now to complicate things a bit more… before saving all the worksheets to their own files, can I have the macro look at each worksheet and adjust the column to width automatically, and do a copy paste special values for each worksheet?
What we have is an ADP download of peoples vacation and flex balances, and we want to email each supervisor their employees vac & flex balances. I’ve used the download from ADP to make a pivot table, I then did a “show pages” function based on the supervisor’s name… this creates the 30 or so worksheets I mentioned in the first request. Since I don’t want everyone to see everyone elses balances I want to copy paste values so the pivot table is no longer a pivot table, plus I want the column widths to be adjusted as well, as some peoples names are longer than others.
Last but not least (I’m having doubt about this one) is there a way to have these newly created files attached to separate emails, going to the correct person based on the file name (the worksheets, and then the new file names based on the worksheet name are the supervisor names). We use lotus notes release 6.
Anyone got any ideas?!?!?!
Thanks so much!!!!!
-
-
-
WSErrolv
AskWoody LoungerAugust 28, 2003 at 11:34 pm #707297LJM,
I put this little ditty together:Sub Breakout()
‘
‘ BreakOut Macro
‘ removes all worksheets, leaving worksheet #1
‘ All worksheets saved to active directory in their own name.
‘
Dim ShHome As String
ShHome = ActiveSheet.NameFor Each Worksheet In Worksheets
Worksheets(2).Move
ActiveWorkbook.SaveAs (ActiveSheet.Name & “.xls”)
ActiveWorkbook.Close
Next Worksheet
End SubIt does nothing with the first worksheet in the bunch, but you can save that outside the loop if you want.
[Added after first posting:}
The ShHome variable can help you recognize the “main” worksheet, and prevent it form being moved out, as
If activeworksheet.name=ShHome then exit subErrol
-
WSAndrew Cronnolly
AskWoody LoungerAugust 29, 2003 at 9:55 am #707524This should copy each sheet to a new file and name them sequentially :
Sub SheetsToFiles() Application.ScreenUpdating = False Dim ws As Worksheet, intIndex As Integer For Each ws In ThisWorkbook.Worksheets ws.Copy intIndex = intIndex + 1 With ActiveWorkbook .SaveAs "File" & intIndex & ".xls" .Close End With Next Application.ScreenUpdating = True End Sub
The original workbook is left intact.
Andrew C
-
WSjlkirk
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSjlkirk
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSbraddy60
AskWoody LoungerJune 12, 2006 at 5:28 am #1015803Hi
Hans solved this problem for me with the the attached code, Create a simple User Form and use this code,
It will allow you to copy 1 or any number of visible worksheets to a new workbook. (Please note the password part of the code you will need to set this to your own password if any!)
Braddy
-
WSHansV
AskWoody LoungerJune 12, 2006 at 5:48 am #1015804Braddy,
The code you attached is incomplete, moreover, the complete version (from the thread starting at post 558,147) acts differently from what has been discussed here: it copies values only, not the entire worksheet including formulas. It’s up to Jeff Kirk to decide if he can use it.
-
WSbraddy60
AskWoody Lounger
-
-
WSAndrew Cronnolly
AskWoody LoungerAugust 29, 2003 at 9:55 am #707525This should copy each sheet to a new file and name them sequentially :
Sub SheetsToFiles() Application.ScreenUpdating = False Dim ws As Worksheet, intIndex As Integer For Each ws In ThisWorkbook.Worksheets ws.Copy intIndex = intIndex + 1 With ActiveWorkbook .SaveAs "File" & intIndex & ".xls" .Close End With Next Application.ScreenUpdating = True End Sub
The original workbook is left intact.
Andrew C
WSLJM
AskWoody LoungerAugust 28, 2003 at 9:12 pm #707193Thank you for your reply, however I should have worded my question a bit differently, as I have about 30 worksheets that I want to save to 30 different files, and I was wondering if there was a fast and quick way to do so without having to do the copy and paste and save as… thanks anyway… I was thinking maybe there was a macro out there or something.
WSstuck
AskWoody LoungerAugust 29, 2003 at 11:00 am #707558The macros already given in this thread should do the job for a large number of sheets but to make a one off/ ad hoc copy of a sheet then:
click Edit
then click Move or Copy Sheet
and explore the options in the dialog box that appearsYou can also get at this feature by right clicking on the sheet name tab.
(not) stuck
WSstuck
AskWoody LoungerAugust 29, 2003 at 11:00 am #707559The macros already given in this thread should do the job for a large number of sheets but to make a one off/ ad hoc copy of a sheet then:
click Edit
then click Move or Copy Sheet
and explore the options in the dialog box that appearsYou can also get at this feature by right clicking on the sheet name tab.
(not) stuck
WSladygnome
AskWoody LoungerAugust 28, 2003 at 8:45 pm #707189Well, my solution isn’t exactly elegant, but what I usually do is simply highlight the entire worksheet by clicking in the upper left corner, right click -select copy. Then create a new workbook and paste the copied sheet in. Then save it as whatever name I like.
I’m fascinated to see how this can be done more quickly and “professionally”.Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Have Copilot there but not taking over the screen in Word
by
CWBillow
2 hours, 4 minutes ago -
4 Strange Facts About Тостер За Сандвичи (Awaiting moderation)
by
rosalinepettey6
8 hours, 15 minutes ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
16 hours, 38 minutes ago -
Are Macs immune?
by
Susan Bradley
14 hours, 1 minute ago -
HP Envy and the Function keys
by
CWBillow
23 minutes ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
1 day, 3 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
1 day, 4 hours ago -
Unable to update to version 22h2
by
04om
14 hours, 55 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
1 day, 11 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
1 day, 11 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
21 hours, 32 minutes ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
2 days ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
1 day, 13 hours ago -
Is your battery draining?
by
Susan Bradley
42 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
3 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
2 days, 4 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
1 day, 12 hours ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
1 day, 12 hours ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
1 day, 5 hours ago -
National scam day
by
Susan Bradley
11 hours, 54 minutes ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
1 day, 8 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
3 days, 5 hours ago -
Tools to support internet discussions
by
Kathy Stevens
1 day, 18 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
2 days, 20 hours ago -
AI is good sometimes
by
Susan Bradley
3 days, 12 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
3 days, 2 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
4 days, 13 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
4 days, 11 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
4 days, 15 hours ago -
Excessive security alerts
by
WSSebastian42
3 days, 6 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.