Macro editing help

Dan Wilson

Well-known Member
Joined
Feb 5, 2006
Messages
546
Office Version
  1. 365
Platform
  1. Windows
Good day. All of the desription following needs to be referenced to Excel 2003. I have a workbook that contains 12 worksheets. Each worksheet is formatted exactly the same. There are 5 Columns on each worksheet. Column A is named the same on each worksheet, Column B is the same on each workhseet, etc. Each worksheet has 250 rows of data, whether they contain data or not.

I have created 5 macros. Each macro will sort the entire worksheet by one of the Columns. The macros are named for their function: ex: sort_business_by_address_number, sort_business_by_street, etc. There are 5 buttons created in Column G (column F is blank for spacing). Button #1 is assigned to the first macro, button 2 the second macro, etc.

Since there are 12 worksheets, I would like to copy the 5 macros from the first worksheet to appear on each one of the 12 worksheets. That means creating another 55 macros identical to the first 5 with only the worksheet name being different in each one.

Is there a way to edit or copy the first 5 macros to create the additional 55 macros? I have tried using Visual Basic and editing the existing macros, but with no success other than to destroy and existing macro.

Any help will be appreciated.
Thanks, Dan...
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Good day Peter. Thank you for responding so quickly. I appreciate the help. There is a lot of text to go through in the article that you referenced, so I will take my time and review it. I'm sure that the answer to my issue is in there somewhere.
Thanks, Dan...
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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