+ Reply to Thread
Results 1 to 15 of 15

VBA Sub private hide all sheet except one

  1. #1
    Forum Contributor
    Join Date
    11-25-2015
    Location
    bangalore
    MS-Off Ver
    2019
    Posts
    120

    VBA Sub private hide all sheet except one

    Hi experts

    I need help on sub worksheet_click function, i want hide all sheet when active Main sheet

    i have list of 20 sheet it takes alot of time to close i want hide all sub sheet except main sheet when i come select or click main sheet

    i want only worksheet_click private function,

    find the attachment.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-25-2015
    Location
    bangalore
    MS-Off Ver
    2019
    Posts
    120

    Re: VBA Sub private hide all sheet except one

    any expert help on this?

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,633

    Re: VBA Sub private hide all sheet except one

    1) to ThisWorkbook code module
    Please Login or Register  to view this content.
    2) to Main sheet code module
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    11-25-2015
    Location
    bangalore
    MS-Off Ver
    2019
    Posts
    120

    Re: VBA Sub private hide all sheet except one

    Thanks for solved i have small issue i have userform with listbox listing sheet names, and i do select and click cmd, to open sheet but it would nt work after i install this code any solution to solve this

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,548

    Re: VBA Sub private hide all sheet except one

    It might help if you show ALL the code.
    Experience trumps academics every day of the week and twice on Sunday.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,633

    Re: VBA Sub private hide all sheet except one

    Quote Originally Posted by julielara View Post
    it would nt work after i install this code any solution to solve this
    Of course, you are now asking completely difference question.

    Upload your workbook with the user form, and explain what do you want to happen when you do what action.

  7. #7
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: VBA Sub private hide all sheet except one

    Hi expert pls find the attachment, i added your code in wb

    thanks
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,693

    Re: VBA Sub private hide all sheet except one

    @Breadwinner - why do you have two user accounts?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,548

    Re: VBA Sub private hide all sheet except one

    In the "UserForm_Initialize" you only need the hidden sheets. "Main" sheet is visisble so does not need to be in the list.
    Add this line before the "Sheet.Activate" line
    Please Login or Register  to view this content.

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,633

    Re: VBA Sub private hide all sheet except one

    julielara or breadwinner,

    You are not answering to my post #6.

    Only my guess
    Delete all the codes I posted in #3.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    11-25-2015
    Location
    bangalore
    MS-Off Ver
    2019
    Posts
    120

    Re: VBA Sub private hide all sheet except one

    Its my hubby account we use same laptop i think its synchronic his threat to my acc while auto fill login

  12. #12
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,548

    Re: VBA Sub private hide all sheet except one

    Does your hubby approve of the suggestions?

  13. #13
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: VBA Sub private hide all sheet except one

    Perfect thanks

  14. #14
    Forum Contributor
    Join Date
    11-25-2015
    Location
    bangalore
    MS-Off Ver
    2019
    Posts
    120

    Re: VBA Sub private hide all sheet except one

    its works perfectly thanks for your valuable time, Thanks alot experts solved!!

  15. #15
    Forum Contributor
    Join Date
    11-25-2015
    Location
    bangalore
    MS-Off Ver
    2019
    Posts
    120

    Re: VBA Sub private hide all sheet except one

    @breadwinner come on mate dont msg on my thread please
    Last edited by julielara; 05-12-2023 at 04:56 PM. Reason: EXPLANATION

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Two Private Sub() on one sheet
    By PingTing in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2021, 08:00 PM
  2. [SOLVED] Once a sheet is copied to another blank sheet how to delete a private sub checkbox
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2019, 03:59 AM
  3. VBA - 2 Private SUB in one sheet
    By Flashback87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2018, 01:19 PM
  4. [SOLVED] two Private Sub Worksheet_Change in on one sheet
    By MetteGaga in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-28-2015, 06:05 AM
  5. Put Private sub into each new sheet
    By ratdogexcel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2013, 10:26 AM
  6. Private sub to hide 0 rows when cell B3 changes value
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2013, 04:55 PM
  7. Calling a Private SUB from SHEET
    By satanovsyn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2011, 08:52 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1