Copying Sheet to End with Macro

jesposi1

New Member
Joined
Sep 16, 2020
Messages
3
Office Version
  1. 2013
Platform
  1. Windows
Hello. I am having a bear of a time trying to get a macro to work. I am recording the macro (with control buttons) by selecting "copy sheet" and "move to end". When I run the macro, my original control buttons are covered up with new buttons that do not work. How do I copy a sheet "to end" and have my original control buttons still function and not get covered up with new buttons? Is there a VBA code for this?

Thanks...
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
It would have helped if you had posted the code that you recorded, I assume you got something like this:
VBA Code:
Sub Button1_Click()
'
' Button1_Click Macro
'

'
    Sheets("Sheet1").Select
    ActiveSheet.Buttons.Add(207.75, 84, 171.75, 63.75).Select
    Sheets("Sheet1").Copy After:=Sheets(3)
End Sub

To prevent the new buttons being create change it to :
VBA Code:
Sub Button1_Click()
'
' Button1_Click Macro
'

'
    Sheets("Sheet1").Select

    Sheets("Sheet1").Copy After:=Sheets(3)
End Sub
i.e. delete the activesheet.buttons.add statement
 
Upvote 0
Thank you for this. This does copy the sheet without screwing up the command button, but I need it to go to the end of the row of sheets. Every day I need to add a new sheet. Today there is 16, tomorrow there ill be 17,...until the end of the month we are in.If I specify where to put the sheet (in this case (3)). It doesn't go to the end. How can I have go to the end when the number of sheets is +1 each day?

Thanks.
 
Upvote 0

Forum statistics

Threads
1,215,469
Messages
6,124,989
Members
449,201
Latest member
Lunzwe73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top