Avatar of witzph1
witzph1
 asked on

How to duplicate worksheet with macros and have macros work in new sheet

I have an Excel workbook with a worksheet that has 3 macro buttons on it, each which sorts and filters a table on the worksheet in a different way.

I would like to copy the worksheet with macro buttons to a new worksheet and have the buttons work on the new one.  When I copy the worksheet now, the macro buttons on the new worksheet bomb out.  I believe because the macro buttons are trying to operate a macro hard coded for another worksheet.

Is there a way to change the macros of the copied sheet easily so they work correctly?  Or should I have created the macros differently so they aren't looking for a specific worksheet?
Microsoft Excel

Avatar of undefined
Last Comment
Saurabh Singh Teotia

8/22/2022 - Mon
Saurabh Singh Teotia

In order to make the changes which you are requesting for..Need to see the code behind the buttons which get executed..then only will be able to help on this..

Either please provide the code or the workbook where you face this problem as it will become faster to help you accordingly..

Saurabh...
witzph1

ASKER
Here it is.
Template.xlsm
ASKER CERTIFIED SOLUTION
Saurabh Singh Teotia

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
witzph1

ASKER
That is really great!  Thank you so much!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Saurabh Singh Teotia

You are welcome..Always happy to help.. :-)

Saurabh...