+ Reply to Thread
Results 1 to 3 of 3

Toggle text Show/Hide Macro

  1. #1
    Forum Contributor
    Join Date
    02-19-2007
    Location
    Poole England
    MS-Off Ver
    2010
    Posts
    117

    Toggle text Show/Hide Macro

    Hello All.

    I have a spreadsheet that I'd love to be able to toggle some text on and off so as to show/hide the text at the click of an assignedmacro button, or toggle button.
    For cross posting purposes I have also posted here;
    http://www.mrexcel.com/forum/showthr...=1#post3115764


    I have 8 separate items of text with these 8 ranges;
    Please Login or Register  to view this content.
    I'm just trying to toggle or shall I say reveal & hide text in the 8 ranges I've mentioned above.

    As a note;
    The text colour is blue and the background in the ranges is black,,,
    so,, just thinking out aloud here, maybe the code might want to just
    colour change the text in the ranges black (So the text would then be hidden).
    As a note, the text colour in all these 8 ranges is;
    RGB: 83,141,213

    I hope somebody can help me here.


    Many thanks for all your time.

    John Caines

  2. #2
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Toggle text Show/Hide Macro

    You can play with font colors, sure. But you could also just put in the cells in question a formula like this:

    =IF(A1=TRUE,"Your message here","")

    Then just tie a checkbox to A1, and checking the box will turn the messages on or off. No coding needed. If you really want to get tricky, you can set the cells locked and hidden properties to true and protect your sheet. Then the user cannot see the text without checking the box (or whatever condition you supply).

    You could also do the same with conditional formatting and font colors, but conditional formatting tends to slow things down if over-used.

  3. #3
    Forum Contributor
    Join Date
    02-19-2007
    Location
    Poole England
    MS-Off Ver
    2010
    Posts
    117

    Re: Toggle text Show/Hide Macro

    Many thanks for your suggestion Whizbang,
    I must mark this as SOLVED as I've just got a reply from somebody called MickG,

    His solution was spot on.
    Here's his code;
    ====================================
    Try this:-
    It works for colorindex , but apparently not for RGB colors.
    This goes Black to Greeny colour.
    Please Login or Register  to view this content.
    If you want to find some "colorIndex" numbers , Colour Value in "A1" then run this code.
    Please Login or Register  to view this content.
    it works exactly as I really wanted it to work.

    So,, case closed!!
    Many thanks again for your suggestion Whizbang,,

    All the best
    TheGhost

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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