VBA New Tab Help

RandyLWalkerJr

Board Regular
Joined
Jul 8, 2014
Messages
77
Hi all,

I’m having trouble with a VBA that I am trying to write and would really appreciate some help.

I want to write a macro that essentially copies the current page in its entirety, transfers it to a new tab, and then allows me to make a few adjustments in the new tab that has just been created. I want to be able to do this for an infinite number of tabs, so that the new tab is always a copy from the one right before it.


Can anyone please help? I’m desperate for some help.


Thanks in advance.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Code:
Sub MakeSheetCopyAfterCurrent()
ActiveSheet.Copy After:=ActiveSheet
End Sub
shall do excatly as needed: make a copy of the current sheet in current workbook, place it just behind the current one and make it active.
 
Upvote 0
If I just wanted to add that line of code into my current VBA, how do I do that? When I try to take out the words "sub" and "end sub", the lines become red.

Thanks.
 
Upvote 0
As you already have some code (registered?), it is already surronded by sub/end sub
insert only
Code:
ActiveSheet.Copy After:=ActiveSheet</pre>
in new line in this place in your code, where you want copying to be executed.
 
Upvote 0
I'm still running into trouble. The macro that I'm trying to create ultimately copies the current tab I am on, copies it over to a new tab, and then makes adjustments on the new tab.

Right now, it is working only for othe first page, but once I try to execute the macro from pages 2-3, I am running into problems. Does anyone know why this could be?
 
Upvote 0

Forum statistics

Threads
1,215,943
Messages
6,127,820
Members
449,409
Latest member
katiecolorado

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