Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Kim Kim is offline
external usenet poster
 
Posts: 284
Default Macro to create new sheet

Hi,

I need to know how can I create a macro where it will create an exact copy.

The work book will have a few sheet and there will be one main sheet which
will be call Master. In the Master sheet, I want to create a button where
they click on it, it will create a new exact sheet. In the new sheet, it
should contain the same button where everytime I click on it, it will create
a new sheet based on the Master sheet.

Anyone can help ?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Macro to create new sheet

Place a button in MasterSheet and assign the below macro. If you are new to
macros; launch VBE using Alt+f11. Insert a module and paste the below code.
Insert a shape to your master. Right click .Assign macro and select the below
Sub

Sub CreateNewSheet()
ActiveSheet.Copy
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Kim" wrote:

Hi,

I need to know how can I create a macro where it will create an exact copy.

The work book will have a few sheet and there will be one main sheet which
will be call Master. In the Master sheet, I want to create a button where
they click on it, it will create a new exact sheet. In the new sheet, it
should contain the same button where everytime I click on it, it will create
a new sheet based on the Master sheet.

Anyone can help ?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Macro to create new sheet

To set it up to copy the MASTER sheet rather than copies of the sheet that
have the button on it, use this code:

Sub MakeCopyOfMasterSheet()
Sheets("Master").Copy After:=Sheets(Sheets.Count)
End Sub

That will place the copy of it at the end of the workbook, and the button
will be on it.

As for the button, I kind of like using the Text Box from the Drawing
toolbar. Put one of those on the Master sheet and put appropriate text in
it, you can even set the colors in it nicely. Finally, right-click on the
edge of the shape (text box) and choose Assign Macro and choose the
MakeCopyOfMasterSheet macro from the list and you should be good to go.
Jacob Skaria gave instructions on how to get the code into the workbook.

Difference between his code and mine: My code always copies the Master
sheet, his code copies whatever sheet you happen to be on when you click the
button. One of the two of us should be right.


"Kim" wrote:

Hi,

I need to know how can I create a macro where it will create an exact copy.

The work book will have a few sheet and there will be one main sheet which
will be call Master. In the Master sheet, I want to create a button where
they click on it, it will create a new exact sheet. In the new sheet, it
should contain the same button where everytime I click on it, it will create
a new sheet based on the Master sheet.

Anyone can help ?

  #4   Report Post  
Posted to microsoft.public.excel.misc
Kim Kim is offline
external usenet poster
 
Posts: 284
Default Macro to create new sheet

Hi Jacob,

Thanks. But I want to create a sheet in the same workbook or additional tab.
At the moment, the macro you give is create a new workbook.

Regards,

"Jacob Skaria" wrote:

Place a button in MasterSheet and assign the below macro. If you are new to
macros; launch VBE using Alt+f11. Insert a module and paste the below code.
Insert a shape to your master. Right click .Assign macro and select the below
Sub

Sub CreateNewSheet()
ActiveSheet.Copy
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Kim" wrote:

Hi,

I need to know how can I create a macro where it will create an exact copy.

The work book will have a few sheet and there will be one main sheet which
will be call Master. In the Master sheet, I want to create a button where
they click on it, it will create a new exact sheet. In the new sheet, it
should contain the same button where everytime I click on it, it will create
a new sheet based on the Master sheet.

Anyone can help ?

  #5   Report Post  
Posted to microsoft.public.excel.misc
Kim Kim is offline
external usenet poster
 
Posts: 284
Default Macro to create new sheet

It work fine now. Thanks.

Now all I need is new macro to assign to move to next or previous. I've
posted another discussion group.

"JLatham" wrote:

To set it up to copy the MASTER sheet rather than copies of the sheet that
have the button on it, use this code:

Sub MakeCopyOfMasterSheet()
Sheets("Master").Copy After:=Sheets(Sheets.Count)
End Sub

That will place the copy of it at the end of the workbook, and the button
will be on it.

As for the button, I kind of like using the Text Box from the Drawing
toolbar. Put one of those on the Master sheet and put appropriate text in
it, you can even set the colors in it nicely. Finally, right-click on the
edge of the shape (text box) and choose Assign Macro and choose the
MakeCopyOfMasterSheet macro from the list and you should be good to go.
Jacob Skaria gave instructions on how to get the code into the workbook.

Difference between his code and mine: My code always copies the Master
sheet, his code copies whatever sheet you happen to be on when you click the
button. One of the two of us should be right.


"Kim" wrote:

Hi,

I need to know how can I create a macro where it will create an exact copy.

The work book will have a few sheet and there will be one main sheet which
will be call Master. In the Master sheet, I want to create a button where
they click on it, it will create a new exact sheet. In the new sheet, it
should contain the same button where everytime I click on it, it will create
a new sheet based on the Master sheet.

Anyone can help ?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Macro to create new sheet

Next or Previous what? Cell? Sheet? Something else?

Got an answer yet?

"Kim" wrote:

It work fine now. Thanks.

Now all I need is new macro to assign to move to next or previous. I've
posted another discussion group.

"JLatham" wrote:

To set it up to copy the MASTER sheet rather than copies of the sheet that
have the button on it, use this code:

Sub MakeCopyOfMasterSheet()
Sheets("Master").Copy After:=Sheets(Sheets.Count)
End Sub

That will place the copy of it at the end of the workbook, and the button
will be on it.

As for the button, I kind of like using the Text Box from the Drawing
toolbar. Put one of those on the Master sheet and put appropriate text in
it, you can even set the colors in it nicely. Finally, right-click on the
edge of the shape (text box) and choose Assign Macro and choose the
MakeCopyOfMasterSheet macro from the list and you should be good to go.
Jacob Skaria gave instructions on how to get the code into the workbook.

Difference between his code and mine: My code always copies the Master
sheet, his code copies whatever sheet you happen to be on when you click the
button. One of the two of us should be right.


"Kim" wrote:

Hi,

I need to know how can I create a macro where it will create an exact copy.

The work book will have a few sheet and there will be one main sheet which
will be call Master. In the Master sheet, I want to create a button where
they click on it, it will create a new exact sheet. In the new sheet, it
should contain the same button where everytime I click on it, it will create
a new sheet based on the Master sheet.

Anyone can help ?

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
macro to create, name sheet and copy. sutha Excel Discussion (Misc queries) 4 December 23rd 08 01:53 PM
How to create macro to go to certain date within excel sheet? Mohamed Excel Discussion (Misc queries) 1 February 28th 07 05:11 PM
How can you create a macro on a protected sheet? Felix Excel Discussion (Misc queries) 2 February 23rd 06 12:37 AM
create a macro to save excel sheet Moussa Hawas Excel Worksheet Functions 1 October 16th 05 09:19 PM
How do I create a macro button and place anywhere on my sheet? Vell H. Holcombe, P.E. Excel Discussion (Misc queries) 1 January 20th 05 04:06 PM


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