Re-Call Private Sub Worksheet_Change(ByVal...

PhilW_34

Board Regular
Joined
Jan 4, 2007
Messages
128
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have code on "Sheet X" which hides other sheets based on a drop-down menu in cell H13. This code works great. (Private Sub worksheet_change(ByVal target As Excel.Range))

What I need to be able to do us run more code on another tab which has to first unhide all hidden sheets before it executes the rest of the code. I can do this too. However, once that code is completed, I want to once again hide these tabs based on the contents of "Sheet X" cell H13.

Basically, I want to call a private sub routine but I can't. I've tried selecting that sheet and then running the worksheet_change code and that doesn't work.

I know I'm being vague here. Ultimately, how can I re-run a private sub worksheet_change routine without manually going to that sheet and selecting that cell? I've tried calling it and using Application.Run and neither work. I get a function not defined error.

Any ideas would be appreciated. Thanks.

Phil
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,224,545
Messages
6,179,432
Members
452,915
Latest member
hannnahheileen

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