+ Reply to Thread
Results 1 to 6 of 6

Search box code - Will display an image and clear to remove image

  1. #1
    Registered User
    Join Date
    07-29-2016
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    79

    Search box code - Will display an image and clear to remove image

    Hello All,

    Can someone assist me with this? Sample file attached with a Vault boy Jpg (40213) and meme frown boy (40212) for reference.

    What I would like to happen is that when If I type the name of the picture in the search field and click search, it will display the image. Clicking clear will remove the image displayed.

    Many Thanks!
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Search box code - Will display an image and clear to remove image

    What name do you want to type? The number 40212 is the name of the object in Excel, but the name "meme frown boy" is unknown to Excel, even if that is the file name it came from.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Search box code - Will display an image and clear to remove image

    Try:
    Please Login or Register  to view this content.
    Assign 'HidePics' to the 'Clear' button, and assign 'SearchPic' to the 'Search' button.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Search box code - Will display an image and clear to remove image

    I took a little different approach,implemented in attached. But you still need to think about what you mean by an image name.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-29-2016
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    79

    Re: Search box code - Will display an image and clear to remove image

    Hi All,

    6StringJazzer hit the right spot! Calling the images based on the Object Name of the image would be the best approach. Thank you so much for the help! In case that I need to add more images in the selection, should I just add additional "S.Name = "Rounded Rectangle 2") and replace it with the correct values right?

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Search box code - Will display an image and clear to remove image

    No. Rounded Rectangle 1 is the name of the Clear button and Rounded Rectangle 2 is the name of the Search button. They are mentioned in the code so you don't hide the buttons when you are hiding the other images. You can add as many images as you want and don't have to change the code.

+ 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. [SOLVED] Insert the first image found with image search (e.g google) with criteria taken from cell.
    By themob212 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 04-14-2021, 12:29 PM
  2. Find & Remove Image Code
    By TLRam1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-08-2015, 10:34 PM
  3. Replies: 0
    Last Post: 07-08-2014, 06:27 AM
  4. [SOLVED] Linking Image to a cell value, and display the selected image in new sheet
    By siva venkata in forum Excel General
    Replies: 12
    Last Post: 03-25-2014, 02:34 AM
  5. Extract and display image URL from "Linked image cannot be displayed" pictures
    By apyken in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2013, 09:52 PM
  6. Display Image Based On Image Name In Cell
    By processchip in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2011, 10:11 AM
  7. VBA to display image on a form - image is defined in Range Name
    By Tan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2006, 10:45 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