Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
How can I save only the active sheet of a workbook in VBA? Marci |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub test() ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:="C:\MyFolder\MySubFolder\Test.xls" ActiveWorkbook.Close End Sub What did you want to happen to the original workbook? -- XL2003 Regards William "VilMarci" wrote in message ... Hi, How can I save only the active sheet of a workbook in VBA? Marci |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Thanks for the quick reply. The main task would be to separate the workbook into separate files per sheet. Marton "William" wrote in message ... Sub test() ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:="C:\MyFolder\MySubFolder\Test.xls" ActiveWorkbook.Close End Sub What did you want to happen to the original workbook? -- XL2003 Regards William "VilMarci" wrote in message ... Hi, How can I save only the active sheet of a workbook in VBA? Marci |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
The code provided will do that - the activesheet.copy command is not like copy and paste. It creates a copy of the active sheet, in a new workbook. The new workbook is then saved, thus saving your sheet. Andi "VilMarci" wrote in message ... Hi, Thanks for the quick reply. The main task would be to separate the workbook into separate files per sheet. Marton "William" wrote in message ... Sub test() ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:="C:\MyFolder\MySubFolder\Test.xls" ActiveWorkbook.Close End Sub What did you want to happen to the original workbook? -- XL2003 Regards William "VilMarci" wrote in message ... Hi, How can I save only the active sheet of a workbook in VBA? Marci |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub test()
Dim sh as Worksheet for each sh in Worksheets sh.Copy Application.displayAlerts = False ActiveWorkbook.SaveAs Filename:="C:\MyFolder\MySubFolder\" & _ sh.Name & ".xls" Application.displayAlerts = True ActiveWorkbook.Close Savechanges:=False Next End Sub -- Regards, Tom Ogilvy "VilMarci" wrote in message ... Hi, Thanks for the quick reply. The main task would be to separate the workbook into separate files per sheet. Marton "William" wrote in message ... Sub test() ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:="C:\MyFolder\MySubFolder\Test.xls" ActiveWorkbook.Close End Sub What did you want to happen to the original workbook? -- XL2003 Regards William "VilMarci" wrote in message ... Hi, How can I save only the active sheet of a workbook in VBA? Marci |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for you all!
This .copy I didn't know. I have a lot of linked cells. Is it possible to use and save the current static values, so the persons who receives the standalone sheets will have all the data they need? Marton "Tom Ogilvy" wrote in message ... Sub test() Dim sh as Worksheet for each sh in Worksheets sh.Copy Application.displayAlerts = False ActiveWorkbook.SaveAs Filename:="C:\MyFolder\MySubFolder\" & _ sh.Name & ".xls" Application.displayAlerts = True ActiveWorkbook.Close Savechanges:=False Next End Sub -- Regards, Tom Ogilvy "VilMarci" wrote in message ... Hi, Thanks for the quick reply. The main task would be to separate the workbook into separate files per sheet. Marton "William" wrote in message ... Sub test() ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:="C:\MyFolder\MySubFolder\Test.xls" ActiveWorkbook.Close End Sub What did you want to happen to the original workbook? -- XL2003 Regards William "VilMarci" wrote in message ... Hi, How can I save only the active sheet of a workbook in VBA? Marci |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Solved.
Thank you all again! Marton "VilMarci" wrote in message ... Thanks for you all! This .copy I didn't know. I have a lot of linked cells. Is it possible to use and save the current static values, so the persons who receives the standalone sheets will have all the data they need? Marton "Tom Ogilvy" wrote in message ... Sub test() Dim sh as Worksheet for each sh in Worksheets sh.Copy Application.displayAlerts = False ActiveWorkbook.SaveAs Filename:="C:\MyFolder\MySubFolder\" & _ sh.Name & ".xls" Application.displayAlerts = True ActiveWorkbook.Close Savechanges:=False Next End Sub -- Regards, Tom Ogilvy "VilMarci" wrote in message ... Hi, Thanks for the quick reply. The main task would be to separate the workbook into separate files per sheet. Marton "William" wrote in message ... Sub test() ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:="C:\MyFolder\MySubFolder\Test.xls" ActiveWorkbook.Close End Sub What did you want to happen to the original workbook? -- XL2003 Regards William "VilMarci" wrote in message ... Hi, How can I save only the active sheet of a workbook in VBA? Marci |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
save only active sheet Button. | Excel Discussion (Misc queries) | |||
How to save a workbook to an active Web Page? | Excel Discussion (Misc queries) | |||
Date each active tab upon save | Excel Discussion (Misc queries) | |||
Active Cell Copy And Paste Sheet to Sheet | New Users to Excel | |||
Save active worksheet to CSV file | Excel Programming |