Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a problem finding out how to copy 4 sheets (mymaster.xls) to another workbook (newWB.xls), the 4 sheets should have the rowheights and formats also copied to the new workbook, another problem is that the master.xls have alot of commandbuttons and other code that i dont want in the newWB. The area that i want copied in every worksheet is A1-S34 in that area there is now commandbuttons. I really hope that there is someone who can help me. thanks, Ole |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This will get you started:
http://www.officearticles.com/excel/...ft_excel .htm You can then select the command buttons with a right-click, or by using your selection tool on the Drawing toolbar. Right-click the sheet tab and choose View Code. Delete all the code in the code window at right. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "ole_" wrote in message ... Hi, I have a problem finding out how to copy 4 sheets (mymaster.xls) to another workbook (newWB.xls), the 4 sheets should have the rowheights and formats also copied to the new workbook, another problem is that the master.xls have alot of commandbuttons and other code that i dont want in the newWB. The area that i want copied in every worksheet is A1-S34 in that area there is now commandbuttons. I really hope that there is someone who can help me. thanks, Ole |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes and no, this is actully a good idea but i dont now if you now what i
mean, all thos i want to do with a macro or commandbutton, i have tried to make one in my personal (im not sure what its called in english) and when i make the macro it works fine, here is what i do: Right-click the sheet tab and choose View Code. Delete all the code in the code window at right, i remove all the modules and then delete all the commandbuttons, then i select all the sheets and copy them to a new workbook, STOP. When i save this workbook it works perfect, but when i run the macro it works fine but dont delete the code in the sheets, it removes the modules and the commandbuttons. Here is the code: Sub deleteallcode3() ' ' deleteallcode3 Makro ' Makro indspillet 30-06-2005 af Ole ' ' Sheets("Ark2").Select ActiveSheet.Shapes("CommandButton1").Select Selection.Delete Sheets("Ark3").Select ActiveSheet.Shapes.Range(Array("CommandButton1", "CommandButton2")).Select Selection.Delete Sheets("Ark4").Select ActiveSheet.Shapes.Range(Array("CommandButton1", "CommandButton2")).Select Selection.Delete Sheets(Array("Ark1", "Ark2", "Ark3", "Ark4")).Select Sheets("Ark1").Activate Sheets(Array("Ark1", "Ark2", "Ark3", "Ark4")).Copy End Sub Any ideas Ole "Anne Troy" skrev i en meddelelse news:ec7ff$42c39b5b$97c5108d$11404@allthenewsgroup s.com... This will get you started: http://www.officearticles.com/excel/...kbook_in_micro soft_excel.htm You can then select the command buttons with a right-click, or by using your selection tool on the Drawing toolbar. Right-click the sheet tab and choose View Code. Delete all the code in the code window at right. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "ole_" wrote in message ... Hi, I have a problem finding out how to copy 4 sheets (mymaster.xls) to another workbook (newWB.xls), the 4 sheets should have the rowheights and formats also copied to the new workbook, another problem is that the master.xls have alot of commandbuttons and other code that i dont want in the newWB. The area that i want copied in every worksheet is A1-S34 in that area there is now commandbuttons. I really hope that there is someone who can help me. thanks, Ole |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try using this to delete the code module, assuming it is a standard code
module Dim vbMod As Object Set vbMod = ActiveWorkbook.VBProject.VBComponents("Module1") ThisWorkbook.VBProject.VBComponents.Remove vbMod -- HTH Bob Phillips "ole_" wrote in message ... Yes and no, this is actully a good idea but i dont now if you now what i mean, all thos i want to do with a macro or commandbutton, i have tried to make one in my personal (im not sure what its called in english) and when i make the macro it works fine, here is what i do: Right-click the sheet tab and choose View Code. Delete all the code in the code window at right, i remove all the modules and then delete all the commandbuttons, then i select all the sheets and copy them to a new workbook, STOP. When i save this workbook it works perfect, but when i run the macro it works fine but dont delete the code in the sheets, it removes the modules and the commandbuttons. Here is the code: Sub deleteallcode3() ' ' deleteallcode3 Makro ' Makro indspillet 30-06-2005 af Ole ' ' Sheets("Ark2").Select ActiveSheet.Shapes("CommandButton1").Select Selection.Delete Sheets("Ark3").Select ActiveSheet.Shapes.Range(Array("CommandButton1", "CommandButton2")).Select Selection.Delete Sheets("Ark4").Select ActiveSheet.Shapes.Range(Array("CommandButton1", "CommandButton2")).Select Selection.Delete Sheets(Array("Ark1", "Ark2", "Ark3", "Ark4")).Select Sheets("Ark1").Activate Sheets(Array("Ark1", "Ark2", "Ark3", "Ark4")).Copy End Sub Any ideas Ole "Anne Troy" skrev i en meddelelse news:ec7ff$42c39b5b$97c5108d$11404@allthenewsgroup s.com... This will get you started: http://www.officearticles.com/excel/...kbook_in_micro soft_excel.htm You can then select the command buttons with a right-click, or by using your selection tool on the Drawing toolbar. Right-click the sheet tab and choose View Code. Delete all the code in the code window at right. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "ole_" wrote in message ... Hi, I have a problem finding out how to copy 4 sheets (mymaster.xls) to another workbook (newWB.xls), the 4 sheets should have the rowheights and formats also copied to the new workbook, another problem is that the master.xls have alot of commandbuttons and other code that i dont want in the newWB. The area that i want copied in every worksheet is A1-S34 in that area there is now commandbuttons. I really hope that there is someone who can help me. thanks, Ole |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy all sheets to a new workbook | Setting up and Configuration of Excel | |||
Copy several sheets from one workbook into another at the same tim | Excel Discussion (Misc queries) | |||
copy workbook sheets? | Setting up and Configuration of Excel | |||
copy a workbook from other workbook with lot of sheets wit... | Excel Discussion (Misc queries) | |||
copy 3 sheets & save them into new workbook | Excel Programming |