Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Copy 1-4 sheets to a new workbook

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default Copy 1-4 sheets to a new workbook

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Copy 1-4 sheets to a new workbook

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Copy 1-4 sheets to a new workbook

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
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
copy all sheets to a new workbook futbol Setting up and Configuration of Excel 3 November 16th 07 12:09 PM
Copy several sheets from one workbook into another at the same tim WiFiMike2006 Excel Discussion (Misc queries) 2 February 8th 07 08:36 PM
copy workbook sheets? L. Setting up and Configuration of Excel 3 November 29th 05 03:30 AM
copy a workbook from other workbook with lot of sheets wit... Vai Excel Discussion (Misc queries) 1 January 3rd 05 10:27 PM
copy 3 sheets & save them into new workbook shital Excel Programming 1 October 21st 03 01:04 AM


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"