Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 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
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
EXCEL SELECTED FILE DOES NOT OPEN ONLY BLANK EXCEL MUST GO THROUG. jcjnew Excel Discussion (Misc queries) 1 September 22nd 05 09:10 AM
changing the way Excel displays selected cells P Boric Excel Discussion (Misc queries) 1 July 28th 05 01:09 PM
How do I view a JPEG file from data selected in Excel gilg Excel Worksheet Functions 0 July 11th 05 09:51 PM
VBA for Excel 2000 file is corrupt nkamp Excel Discussion (Misc queries) 0 May 26th 05 03:37 PM
linking with cells of others excel file Omar Peru Excel Discussion (Misc queries) 0 May 8th 05 08:51 PM


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