Good day,
I am new in excel vb programming and i want to seek help from excel master, can any one help to auto insert image base on the result of search data,Attachment 615781
Good day,
I am new in excel vb programming and i want to seek help from excel master, can any one help to auto insert image base on the result of search data,Attachment 615781
Last edited by MyVB_polly; 03-16-2019 at 01:15 AM.
Hi,
You also have to tell where the picture is stored.
This link will give you some ideas
https://trumpexcel.com/picture-lookup/
Hope this helps, we can always help later if you cannot make it work
Why is your file in an older format? You are using 2010
---
Hans
"IT" Always crosses your path!
May the (vba) code be with you... if it isn't; start debugging!
If you like my answer, Click the * below to say thank-you
Thanks Keebellah
picture are stored in X:\2 Picture\02 Bitmap
i tried that one but when the search result display, the image didn't show up, but when i manually type the number ex. "10-26000" and hit enter it show up the image.
may be i can change it to enable macro. yes i am using ms 2010.
Well, try the link I posted,
I don't have the same path so you will have to edit it yourself.
I suggest you save the file as an xlsm (marco embedded file) after you modified the xls file.
If you look at the contents of the cell in Column A and if you check that cell you will see that the value is '10-26005 with the apostrophe and that is the reason it won't work when the macro runs but only when you enter the value manually.
I'll see if I can try something, the shape should fill the destination cell, correct?
Question, the shape's name: is that the partnumber, what is the text in column G?
Okay, I got it working, will upload after dinner
As promised:
My (working code)
The file's attached in xlsm formatPlease Login or Register to view this content.
Again thank you very much
did you put some missing code?
because i encounter error when i try it.
this is the pup up error .Untitled.png
i couldn't fix it.
this is the sample image
Nope as far I can see you are the one missing out.
Read the the lines BELOW LastRow
I am sorry but i don't know how to fix it. could you please tell me what to do?
Does the folder that is mentioned in the const filepath exist?
Yes the folder existing. i also tried to move the folder to my desktop. but still it wont work.
Can you attach YOUR file again?
This is just something you have to check, it worked here so maybe the name in the cell is invalid or it's empty or something else.
here are the files.
Thanks will look at it
The reason you got the error is because you did not include a check to see if the selected target cell contained any text.
Apart from that you hard-code a full path in your code so that when you decide to change the picture folder to another location you always have to edit the vba code like I did to able to test it.
I made some (mayor) modifications to your file and added some code to make it work.
The first one is check if the picture folder is present (known to the file), if not a browser will open that will permit you to select the folder containing the images, if the selected folder contains no images the process will not run.
I added two extra buttons, on with text and one is an image of FOLDER
The SEARCH button is unchanged except for the fact that I assure it affects the correct worksheets. in your case you omitted this so it you start the macro while you're still in the DATA sheet it erases the content of the data sheet.
Once the SEARCH is pressed all images are cleared as well as the text NO IMAGE FOUND, not a file just text in that cell.
After the SEARCH is completed then you press the button REFRESH SHAPES, this macro processes the present list and places the images in their place or the text NO IMAGE FOUND in the corresponding cell
Pressing the FOLDER button allows you to select another folder for the images location.
(see attached thumbnail)
Reduced the vba code to a single module for image placement and also removed the unnecessary black borders which you had over the entire worksheets height (over 1 million rows )
You can make it 'dynamic'using Conditional format rules.
Let me know if it all works on your side too, the day's almost over on your side of the globe
Sorry, i will try it.
Thank you very much.
Good day,
Sorry for the late reply, this are the error i enconter when i pon your work. what should i do?
Sorry my mistake, should have added an extra check to verify if a correct image folder had been selected. Added a correction and this should work, if not... let me know.
HI
Wow you are so good in this kind of work.
it works now!
thank you very much keebellah.
one more thing how can i auto resize the cell according to the size of bitmap
?
Why would you want to do that? It will make the list very messy.
If it's just to see the bitmap with more detail there is a way to show the full bitmap in a userform that cab be zoomed in or out.
Right-Click Column B and see if this helps you
The image can be resized by dragging at the corners
Wow this is so awesome. thank you very much keebella.
your so great.
You're welcome
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks