Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default save worksheets as seperate files (I know how to do it one by one)

I have an excel file with over 20 worksheets and I need to create a with each
of those sheets. Does somebody know how to do it in practical terms. I know
how to do it one by one but it takes time.
thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default save worksheets as seperate files (I know how to do it one by one)

hi,
here is a "save range" macro i wrote for myself some years back. it might do
what you want. select the sheet and run the macro.
Sub mac1SaveRange()

'Macro written by FSt1 4/27/03

Dim cnt As Long
Dim cell As Range
On Error GoTo err1

MsgBox "You have selected range" & Selection.Address
If Selection.Cells.Count = 1 Then
If MsgBox("You have selected only one cell. Continue?????", vbYesNo,
"Warning") = vbNo Then
Exit Sub
End If
End If
cnt = 0
For Each cell In Selection
If Not IsEmpty(cell) Then
cnt = cnt + 1
End If
Next
If cnt = 0 Then
If MsgBox("There is no data in the selected range. Continue?!?!?!?!?",
vbYesNo, "Warning") = vbNo Then
Exit Sub
End If
End If
'ActiveSheet.UsedRange.Select
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
Application.Dialogs(xlDialogSaveAs).Show
err1:
MsgBox ("Need a range to save, Speedbrain.")
Exit Sub
End Sub

regards
FSt1

"SANCAKLI" wrote:

I have an excel file with over 20 worksheets and I need to create a with each
of those sheets. Does somebody know how to do it in practical terms. I know
how to do it one by one but it takes time.
thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default save worksheets as seperate files (I know how to do it one by one)

You could use a macro:

Option explicit
sub testme()
dim wks as worksheet
for each wks in activewindow.selectedsheets
wks.copy 'to a new workbook
with activesheet
.parent.saveas filename:="C:\temp\" & .name & ".xls", _
fileformat:=xlworkbooknormal
.parent.close savechanges:=false
end with
next wks
end sub

Click on the first sheet tab to be saved and ctrl-click on subsequent. Then run
the macro.

And change the folder to what you need. I used C:\temp.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm




SANCAKLI wrote:

I have an excel file with over 20 worksheets and I need to create a with each
of those sheets. Does somebody know how to do it in practical terms. I know
how to do it one by one but it takes time.
thanks.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save worksheet to seperate file? George Excel Discussion (Misc queries) 4 October 30th 06 08:30 PM
how to export worksheets into seperate files PeterRad Excel Discussion (Misc queries) 2 August 9th 06 04:10 AM
How do I seperate data from a pivot into seperate worksheets? Shannon Excel Discussion (Misc queries) 5 August 25th 05 06:07 AM
Save worksheets to different files Tere Gardner Excel Worksheet Functions 3 May 2nd 05 09:03 PM
Excel 2000 worksheets save incorrectly as notepad files. Capdu Excel Discussion (Misc queries) 2 April 2nd 05 03:47 PM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"