+ Reply to Thread
Results 1 to 7 of 7

Macro Hiding Sheet Not Working as Planned

  1. #1
    Registered User
    Join Date
    04-05-2016
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Microsoft Office Professional Plus 2013
    Posts
    40

    Macro Hiding Sheet Not Working as Planned

    Hi everyone - I'm trying to get a macro to hide a sheet in my workbook when a certain condition is met in a certain cell. In this case, when the cell (which I've named term) has the value "No Contract", I would like the sheet to hide itself.

    What I have is working, but not immediately upon entering "No Contract". For some reason, I have to enter "No Contract" and then click on the cell again to get it to hide, but I want it to be an immediate response to entering that value. I'm not very experienced in macros so I'm not sure where I'm going wrong.

    Here is what I've got - again the cell which I want to trigger this is called Term and the worksheet is called COMPASS:

    Please Login or Register  to view this content.
    Any advice would be greatly appreciated!

    Thanks

  2. #2
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,890

    Re: Macro Hiding Sheet Not Working as Planned

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    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.

  3. #3
    Registered User
    Join Date
    04-05-2016
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Microsoft Office Professional Plus 2013
    Posts
    40

    Re: Macro Hiding Sheet Not Working as Planned

    Sorry about that - fixed now

  4. #4
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,890

    Re: Macro Hiding Sheet Not Working as Planned

    Thank you.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Macro Hiding Sheet Not Working as Planned

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  6. #6
    Registered User
    Join Date
    04-05-2016
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Microsoft Office Professional Plus 2013
    Posts
    40

    Re: Macro Hiding Sheet Not Working as Planned

    Thanks @Mumps1! Any advice on how I could make it recognize variations of "No Contract" such as "no contract" and "No contract"?

    Thanks!

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Macro Hiding Sheet Not Working as Planned

    Try:
    Please Login or Register  to view this content.

+ 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. Macro working on incorrect sheet - hiding rows
    By Cchoma in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-08-2015, 01:27 AM
  2. Macro Not working - Consolidate different sheet into 1 sheet and merge into 1 tab
    By gpcarthik in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2014, 03:08 PM
  3. Hiding Sheets based on cell value, only hiding last sheet
    By mattblack2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2014, 03:21 PM
  4. [SOLVED] Macro for hiding rows before print not working
    By gocolonel77 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-28-2013, 11:05 PM
  5. [SOLVED] Macro for hiding rows not working
    By sunilwadhwa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2012, 04:31 PM
  6. Code not working as planned
    By sulavsingh6 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2009, 03:53 PM
  7. Print Macro not working...hiding extra fields
    By LarryC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2008, 08:21 AM

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