+ Reply to Thread
Results 1 to 9 of 9

VBA Hide if cell value = TEXT not working

  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Question VBA Hide if cell value = TEXT not working

    Hi There,

    Im trying to hide and unhide certain rows depending on what value is in cell F8, but cant seem to get the below code to fire
    The code is in the the sheet i want it to work in.

    Could someone tell me what I'm doing wrong?

    Cheers Folks

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: VBA Hide if cell value = TEXT not working

    You put End If in the wrong place.
    And you can remove the 'select' part.
    Try this:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: VBA Hide if cell value = TEXT not working

    Hi Akuini,

    Thanks for that

    The code only seems to work when I run it from the developer, it doesn't fire automatically when I change the value from the drop down list in cell F8?

    Regards
    Carl

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: VBA Hide if cell value = TEXT not working

    Right click on your sheet name >> view code >> paste the following code there-

    Please Login or Register  to view this content.
    This should fire automatically when F8 changes.
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  5. #5
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: VBA Hide if cell value = TEXT not working

    Ah, Sourabh already got the answer. I deleted my post.

  6. #6
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: VBA Hide if cell value = TEXT not working

    Hi Guys,

    Thanks for your efforts with this,

    The code doesn't seem to be working, I've attached a sample for a some clarity.


    Thanks
    Carl
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: VBA Hide if cell value = TEXT not working

    Hi sourabhg98,

    I cant seem to get the code to work, can you see if i'm doing something wrong

    Thanks
    Carl

  8. #8
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: VBA Hide if cell value = TEXT not working

    Hi

    You cant add a new macro with the name Worksheet_Change1.
    Only macro named with Worksheet_Change is triggered when value is changed.
    Combine both the codes and use only one like this-
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: VBA Hide if cell value = TEXT not working

    Hi sourabhg98,

    That's great, it works like a treat

    Thanks Again
    Carl

+ 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. Hide Columns Macro - Working on Windows not working on Mac OSX
    By bcadar in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-08-2016, 09:05 AM
  2. Text stacked in one cell - text to columns not working
    By SirLosealot in forum Excel General
    Replies: 2
    Last Post: 10-08-2015, 06:58 AM
  3. Replies: 2
    Last Post: 04-26-2014, 07:34 PM
  4. If No - Hide certain cell text, If Yes display the text
    By Louie555 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-15-2013, 09:53 AM
  5. [SOLVED] Classic hide rows if cell value is zero - not working, please help!
    By Dunamis17 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2012, 09:09 AM
  6. [SOLVED] Hide text in shaded cell
    By mmb in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-04-2005, 05:35 PM
  7. [SOLVED] Is there a way to hide text in a cell?
    By IT Assistant in forum Excel General
    Replies: 2
    Last Post: 04-26-2005, 11:06 PM

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