+ Reply to Thread
Results 1 to 11 of 11

Show shape on cell select, Hide shape when cell is deselected

  1. #1
    Registered User
    Join Date
    04-14-2014
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2019 (PC) Version 1808
    Posts
    46

    Show shape on cell select, Hide shape when cell is deselected

    I have a shape named "txt1" that I want to show when cell A1 is seleceted, and hide when A1 is not selected, similar to an input message. Any ideas?? Thank you in advance.

    Brendan
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Show shape on cell select, Hide shape when cell is deselected

    Rename your shape by selecting it and type in name box "MyShape" then
    In worksheet module put the code

    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Show shape on cell select, Hide shape when cell is deselected

    Hello brendangroff,

    You can do much better with only selecting Cell A1, by adding a Dropdown Box, and then select any image of your choice.

    Please try the attached sample Workbook, and see if you can make it work for you. If you have any questions, just ask.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Registered User
    Join Date
    04-14-2014
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2019 (PC) Version 1808
    Posts
    46

    Re: Show shape on cell select, Hide shape when cell is deselected

    Bada bing, bada boom--you're the coolest guy in the room. Thanks for the help YasserKhalil!

    Brendan

  5. #5
    Registered User
    Join Date
    04-14-2014
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2019 (PC) Version 1808
    Posts
    46

    Re: Show shape on cell select, Hide shape when cell is deselected

    Thank you Winon!! Good stuff

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Show shape on cell select, Hide shape when cell is deselected

    You're welcome. Glad I can offer some help
    Please mark the thread as solved

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Show shape on cell select, Hide shape when cell is deselected

    Hi brendangroff,

    Glad you like it, you are welcome.

    Thank you for the feedback, and for adding to my Reputation. Much appreciated!

    Regards.

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Show shape on cell select, Hide shape when cell is deselected

    @ YasserKhalil,

    Your PM Inbox is full and as such does not comply with my Friends Rule No. 4c, Chapter 3, Clause 5.b, Section 5 of Chapter 2!

    Until you abide to that Rule as stipulated above, and you do not Empty your PM Inbox, I shall be compelled to not send you any PM's.

    Please consider this as a Final Warning!!!

    Thank you.

    Edit: This "Moderation Request" may now be ignored, as YasserKhalil complied with "My Rules"!
    Last edited by Winon; 08-25-2016 at 02:41 PM.

  9. #9
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Show shape on cell select, Hide shape when cell is deselected

    @Winon
    I can't object you and according to Rule No. 4c, Chapter 3, Clause 5.b, Section 5 of Chapter 2! Item number 1!!
    I did it and empty the box to avoid any warning ..
    Thanks for your coming PM
    Regards

  10. #10
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Show shape on cell select, Hide shape when cell is deselected

    Could someone explain to me where the image is stored on Winon's example? Just trying to learn some more.

    Thank You

  11. #11
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Show shape on cell select, Hide shape when cell is deselected

    @ YasserKhalil,

    Things in general are far too serious and clinical in the most of the Forum topics, and besides the Water Cooler, I thought it would do no harm in relaxing things up a bit here as well.

    You now have a PM from me. Thank you.

    @ zplugger,

    I do admire your inquiring mind and keen interest in the solutions provided in this Forum.

    If you look at the Code of the sample Workbook I have posted, you will see that there are three pictures. Picture 1, Picture 2 and Picture 3. These pictures are placed randomly anywhere on the Sheet you would be working with. In Column N which is hidden, I have "attached" a name to each of the three pictures, using VBA code. In Cell A I created a DropDown list based on the values in the hidden Column "N". From there the Code takes control, and if Cell A is empty, all pictures are hidden.

    Now, when you select a "Name attached" to the picture in Cell A, that picture will show where it is placed on the Sheet. You may leave it where it displays, or if you like, you may click on the picture and drag it to where you want it. In the sample Workbook for instance, I have dragged each Picture to the same area/Cell where I want it to show. The pictures are now stacked upon each other, while hidden, until you select a "Name" in Cell A, and only then that picture will show.

    Apologies if the above is as clear as mud. Should you require more information, please just ask.

    Regards.

+ 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. Automatically bringing a Shape into a Cell Using Shape Code
    By dineshtendulkar in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-16-2016, 02:25 PM
  2. show hide shape to a cell problem with code
    By pavlos_x in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-26-2015, 02:43 PM
  3. [SOLVED] show hide shape to a cell according to its value
    By pavlos_x in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-14-2015, 05:34 PM
  4. Define Shape [Rectangle / L Shape] by cell content
    By SonOfOdin in forum Excel General
    Replies: 8
    Last Post: 12-30-2014, 06:17 AM
  5. [SOLVED] A macro after setting onaction for a shape that will select the shape.
    By vonRobbo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2014, 11:34 PM
  6. Select a shape based on a cell value and update the shape when value changes
    By BigAl99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2013, 12:06 PM
  7. Hide/show shape on Sheet1 based on cell value in Sheet2?
    By Guple in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-05-2013, 02:12 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