call macro within a macro?

merlin777

Well-known Member
Joined
Aug 29, 2009
Messages
1,397
Office Version
  1. 2007
can you call a macro within a macro?

I have a macro that inserts a row and some data into a table but it errors if the table is filtered. I have another macro which clears the filters.

Is it possible to start the insert row macro with the remove filter macro? It feels like that will be easier than writing code to remove it within the insert macro.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
can you call a macro within a macro?

I have a macro that inserts a row and some data into a table but it errors if the table is filtered. I have another macro which clears the filters.

Is it possible to start the insert row macro with the remove filter macro? It feels like that will be easier than writing code to remove it within the insert macro.


I don't fully understand your macros but generally you can call a macro within a macro by

Code:
'''your code

call macro1   'you just called a macro called macro1
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,458
Members
448,899
Latest member
maplemeadows

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