#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default q; Writing to files


I have an excel file I create a pivotal table and print each group to
separate paper. I need to write a macro to save each group to a separate
file. Can anybody write me a macro to do this?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default q; Writing to files

hi,
here is a "save range" macro i wrote for myself some time back. you may have
to play with it. you have to select the range(group) to save.
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
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
Application.Dialogs(xlDialogSaveAs).Show
err1:
MsgBox ("Need a range to save.")
MsgBox("Idiot!")
Exit Sub
End Sub

regards
FSt1

"JIM.H." wrote:


I have an excel file I create a pivotal table and print each group to
separate paper. I need to write a macro to save each group to a separate
file. Can anybody write me a macro to do this?

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
Writing to csv Jeff Excel Discussion (Misc queries) 2 March 16th 07 01:35 PM
Sum not including writing Be18 New Users to Excel 2 February 27th 07 03:32 PM
Writing a Marco Curtis Excel Worksheet Functions 1 October 30th 06 02:32 AM
Writing a formula changetires Excel Discussion (Misc queries) 1 June 27th 06 05:18 PM
Need Help Writing a Formula Lynn Excel Worksheet Functions 11 September 11th 05 07:51 PM


All times are GMT +1. The time now is 12:05 PM.

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

About Us

"It's about Microsoft Excel"