Hello, I'm using the following code to generate a TOC. Is there a way to make it exclude any hidden sheets?
Many thanks.
Please Login or Register to view this content.
Hello, I'm using the following code to generate a TOC. Is there a way to make it exclude any hidden sheets?
Many thanks.
Please Login or Register to view this content.
Last edited by MaggieLou; 01-21-2021 at 12:18 PM.
Yes, quite easily in fact.
But first you need to comply with the forum rules and use code tags around the code in your post.
BSB
sorry, 2nd day on site. Is this correct?
Please Login or Register to view this content.
I kinda meant put the code tags in your original post....
Add the lines in red to your code and give that a whirl.
BSBPlease Login or Register to view this content.
Got it, thanks for the guidance.
And thanks for the code - works perfectly.
Happy to help.
Worth pointing out that you rarely need to select a range to manipulate it through VBA.
So this from your code:
Could just as easily be:Please Login or Register to view this content.
I'd already changed the ClearContents part near the start of your code but didn't spot this one until after I replied.Please Login or Register to view this content.
BSB
thanks again! I'm such a VBA newbie - I really appreciate it!
No problem. We're here to help. We were all VBA noobs at some point :D
BSB
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks