Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I save only active worksheet without save all of worksheet | Excel Worksheet Functions | |||
When you hit Save on a template, how can you save as worksheet? | Excel Worksheet Functions | |||
Sort Worksheet Range from another worksheet range, Excel 2000 & 2003 | Excel Programming | |||
Save Excel Worksheet As CSV - No Save As Dialog | Excel Programming | |||
Worksheet Buttons (Save, Save As, Cut, Paste, etc.) Not Working | Excel Worksheet Functions |