Run Macro when entering a worksheet

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
Is it possible to have a macro run each time entering a worksheet within an open workbook?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Is it possible to have a macro run each time entering a worksheet within an open workbook?
If you mean when you activate a worksheet, you would use the Worksheet_Activate event to run the code. If you mean when data is entered into a worksheet then either the Worksheet_Change event or the Worksheet_SelectionChange events could be used. These would be Private Sub stored in the worksheet code module.
 
Upvote 0

Forum statistics

Threads
1,196,409
Messages
6,015,105
Members
441,870
Latest member
kojack

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