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.
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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 18 years, 11 months 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
-
KB5058379 / KB 5061768 Failures
by
crown
6 hours, 13 minutes ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
8 hours, 52 minutes ago -
At last – installation of 24H2
by
Botswana12
9 hours, 36 minutes ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
2 hours, 39 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
21 hours, 48 minutes ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
15 hours, 8 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
1 day, 11 hours ago -
Another test post
by
gtd12345
1 day, 11 hours ago -
Connect to someone else computer
by
wadeer
1 day, 5 hours ago -
Limit on User names?
by
CWBillow
1 day, 9 hours ago -
Choose the right apps for traveling
by
Peter Deegan
22 hours, 48 minutes ago -
BitLocker rears its head
by
Susan Bradley
6 hours, 49 minutes ago -
Who are you? (2025 edition)
by
Will Fastie
5 hours, 46 minutes ago -
AskWoody at the computer museum, round two
by
Will Fastie
1 day, 1 hour ago -
A smarter, simpler Firefox address bar
by
Alex5723
1 day, 21 hours ago -
Woody
by
Scott
2 days, 7 hours ago -
24H2 has suppressed my favoured spider
by
Davidhs
6 hours, 26 minutes ago -
GeForce RTX 5060 in certain motherboards could experience blank screens
by
Alex5723
2 days, 21 hours ago -
MS Office 365 Home on MAC
by
MickIver
2 days, 15 hours ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
3 days, 11 hours ago -
Flash Drive Eject Error for Still In Use
by
J9438
6 hours, 10 minutes ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
4 days, 6 hours ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
4 days, 6 hours ago -
AI model turns to blackmail when engineers try to take it offline
by
Cybertooth
3 days, 9 hours ago -
Migrate off MS365 to Apple Products
by
dmt_3904
3 days, 10 hours ago -
Login screen icon
by
CWBillow
3 days, 1 hour ago -
AI coming to everything
by
Susan Bradley
15 hours, 38 minutes ago -
Mozilla : Pocket shuts down July 8, 2025, Fakespot shuts down on July 1, 2025
by
Alex5723
4 days, 21 hours ago -
No Screen TurnOff???
by
CWBillow
4 days, 22 hours ago -
Identify a dynamic range to then be used in another formula
by
BigDaddy07
2 hours, 33 minutes 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.