+ Reply to Thread
Results 1 to 12 of 12

Hide or show an object based on a cell value

  1. #1
    Forum Contributor
    Join Date
    09-19-2014
    Location
    Michigan
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    145

    Hide or show an object based on a cell value

    Hello
    I am trying to hide or show an object based on a cell value on another sheet. Below is the code I am trying, but it's not working.

    A25 on sheet "Enter Data Here" Will always be true or false.
    The "object" is word art that I have named "HSV_Warn"

    Hope someone can help. Maybe I am going about this the wrong way?

    PHP Code: 
    Private Sub HSV_Warn(ByVal Target As Range)
         If 
    Sheets("Enter Data Here").Range("A25").Value True Then
              Sheets
    ("Binder Cover").Object("HSV_Warn").Visible True
         
    Else
              
    Sheets("Binder Cover").Object("HSV_Warn").Visible False
         End 
    If
    End Sub 

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Hide or show an object based on a cell value

    Perhaps you could put this in the module of the sheet 'Enter Date Here'.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    09-19-2014
    Location
    Michigan
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    145

    Re: Hide or show an object based on a cell value

    Not doing anything. Just like mine. :/

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Hide or show an object based on a cell value

    Works for me, where exactly did you put the code and what is actually going in cell A265 on 'Binder Cover'?

  5. #5
    Forum Contributor
    Join Date
    09-19-2014
    Location
    Michigan
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    145

    Re: Hide or show an object based on a cell value

    I put it in the module of the sheet "Enter data here".

    There is nothing in a265.

  6. #6
    Forum Contributor
    Join Date
    09-19-2014
    Location
    Michigan
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    145

    Re: Hide or show an object based on a cell value

    Is it an issue that what I am trying to hide is word Art?

  7. #7
    Forum Contributor
    Join Date
    09-19-2014
    Location
    Michigan
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    145

    Re: Hide or show an object based on a cell value

    I just copy and pasted the word are at a picture. still no luck.

  8. #8
    Forum Contributor
    Join Date
    09-19-2014
    Location
    Michigan
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    145

    Re: Hide or show an object based on a cell value

    The true false value is based on a check in "Check Box 6" is that my issue?

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Hide or show an object based on a cell value

    A265 is a typo, I meant A25.

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED, scroll down and click Manage Attachments.

  10. #10
    Forum Contributor
    Join Date
    09-19-2014
    Location
    Michigan
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    145

    Re: Hide or show an object based on a cell value

    The value of a25 is base on a check in "check box 6" If I TYPE true or false it works. I just need it to work with the check box. I believe this is my bad for not explaining that.

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Hide or show an object based on a cell value

    If you created the checkbox from the Forms toolbar right click it, select Assign Macro... and click New.

    You should now see something like this.
    Please Login or Register  to view this content.
    Add this code to the above sub.
    Please Login or Register  to view this content.
    If the checkbox is an ActiveX checkbox double click it and add this code to the sub that appears, replacing CheckBox1 with the actual name of the checkbox.

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    09-19-2014
    Location
    Michigan
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    145

    Re: Hide or show an object based on a cell value

    Thank you!!!!!

+ 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 Or Show An Image Based On A Cell Value
    By kc27315 in forum Excel General
    Replies: 21
    Last Post: 06-12-2023, 03:55 AM
  2. Show Hide Rows based on cell value
    By Juicy2052 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2015, 07:55 AM
  3. [SOLVED] Hide/show row based on cell value
    By zanguard80 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2015, 03:06 PM
  4. Hide an object based on auto calculated cell value
    By Flyer_man in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-26-2013, 09:06 PM
  5. Hide/Show Columns based on Cell Value
    By Woodjr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-05-2013, 04:12 AM
  6. [SOLVED] Hide/Show rows based on the value in a cell
    By PatRiot199 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-11-2012, 11:52 PM
  7. Show & Hide Object
    By eddykk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2009, 08:31 PM

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