Trigger events after hiding a column

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Trigger events after hiding a column

Post by YasserKhalil »

Hello everyone
How can I trigger a code or event after hiding a column for example?
Or how to recalculate the worksheet automatically?

User avatar
HansV
Administrator
Posts: 78384
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Trigger events after hiding a column

Post by HansV »

Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Re: Trigger events after hiding a column

Post by YasserKhalil »

Thanks a lot. Is there any other workaround away from Ribbon XML?
I remember something such as a formula (specific formula) put in a cell that triggers the events..but didn't find a clue.

User avatar
HansV
Administrator
Posts: 78384
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Trigger events after hiding a column

Post by HansV »

You can use a formula to trigger the Worksheet_Calculate event when you hide or unhide rows. This does not work for columns, however.
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Re: Trigger events after hiding a column

Post by YasserKhalil »

That's weird. So this trick only works for hiding the rows. What about the columns?!
Thanks a lot, my tutor for your support.

User avatar
HansV
Administrator
Posts: 78384
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Trigger events after hiding a column

Post by HansV »

I already mentioned that the formula trick doesn't work for columns. The only method appears to be the Ribbon XML one.
Best wishes,
Hans