Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Create a new Excel file with selected cells
Hi All,
I need your help once again. I have a Dashboard with five sheets and I was wondering if there is a function to create a new Excel file based on the data selected from the Dashboard. I would like to select data or cells from different sheets from the Dashboard then create a new Excel file with the data selected using a macro or vb. I guess I could just copy and paste the data from one file to another but there are a large number of cells I need to select. I would like to know if I could automate this process. Thanks in advance. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Create a new Excel file with selected cells
hi,
here is a sub that i use to save ranges. select the range you want to save to another file and run the macro. i have this in a personal menu. Sub mac1SaveRange() 'Macro written by FSt1 4/27/02 Dim cnt As Long Dim cell As Range 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 End Sub "john" wrote: Hi All, I need your help once again. I have a Dashboard with five sheets and I was wondering if there is a function to create a new Excel file based on the data selected from the Dashboard. I would like to select data or cells from different sheets from the Dashboard then create a new Excel file with the data selected using a macro or vb. I guess I could just copy and paste the data from one file to another but there are a large number of cells I need to select. I would like to know if I could automate this process. Thanks in advance. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Create a new Excel file with selected cells
Hi,
Thanks for your help. The Macro works great. Is it possible to select multiple ranges from multiple sheets then create the new Excel file? Thanks for your help. Jose FSt1 wrote: hi, here is a sub that i use to save ranges. select the range you want to save to another file and run the macro. i have this in a personal menu. Sub mac1SaveRange() 'Macro written by FSt1 4/27/02 Dim cnt As Long Dim cell As Range 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 End Sub "john" wrote: Hi All, I need your help once again. I have a Dashboard with five sheets and I was wondering if there is a function to create a new Excel file based on the data selected from the Dashboard. I would like to select data or cells from different sheets from the Dashboard then create a new Excel file with the data selected using a macro or vb. I guess I could just copy and paste the data from one file to another but there are a large number of cells I need to select. I would like to know if I could automate this process. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
EXCEL SELECTED FILE DOES NOT OPEN ONLY BLANK EXCEL MUST GO THROUG. | Excel Discussion (Misc queries) | |||
changing the way Excel displays selected cells | Excel Discussion (Misc queries) | |||
How do I view a JPEG file from data selected in Excel | Excel Worksheet Functions | |||
VBA for Excel 2000 file is corrupt | Excel Discussion (Misc queries) | |||
linking with cells of others excel file | Excel Discussion (Misc queries) |