Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Save range as new worksheet

I need to save a range in a worksheet as a new worksheet. How can I define a
Saveas to only save the particular range?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Save range as new worksheet

hi,
here is a save range sub i have in my personal.xls
you can use it as an example to create your own.
it requires that you select the range you wish to save to another workbook.
Sub mac1SaveRange()

'Macro written by FSt1 4/27/02

Dim cnt As Long
Dim cell As Range

'ActiveSheet.UsedRange.Select
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
End Sub

regards
FSt1

"Art" wrote:

I need to save a range in a worksheet as a new worksheet. How can I define a
Saveas to only save the particular range?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Save range as new worksheet

Hi Art,

Add a new worksheet and then copy
the required range to the new sheet.

If you need to automate this, turn on the
macro recorder and perform the necessary
operations manually. This will provide you
with code which may be edited to afford
more generic application.

If you experience problems in editing the
recorder code, post back with the
problematic code.



---
Regards.
Norman


"Art" wrote in message
...
I need to save a range in a worksheet as a new worksheet. How can I define
a
Saveas to only save the particular range?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Save range as new worksheet

Hi Art,

I note that, in an adjacent post, FSti
has assumed that your intention is to
create a new workbook wheras my
response was predicated on the
creation of a new worksheet.

If, therefore, you wish to create a
new workbook, utilise the code
provided by FSti.



---
Regards.
Norman
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
How do I save only active worksheet without save all of worksheet droth Excel Worksheet Functions 2 February 21st 09 05:11 PM
When you hit Save on a template, how can you save as worksheet? cwgirl1982 Excel Worksheet Functions 1 September 4th 08 11:18 PM
Sort Worksheet Range from another worksheet range, Excel 2000 & 2003 jfcby[_2_] Excel Programming 1 August 21st 07 02:55 AM
Save Excel Worksheet As CSV - No Save As Dialog SQLServant Excel Programming 1 September 29th 06 12:36 PM
Worksheet Buttons (Save, Save As, Cut, Paste, etc.) Not Working SuzieQ12345 Excel Worksheet Functions 5 January 21st 05 02:57 PM


All times are GMT +1. The time now is 04:11 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"