VBA - Macro for getting pictures from file that match cell value

firasawad

New Member
Joined
Nov 7, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

i don't seem to find the VBA anywhere online,i have been searching for the last 5 hours. need your help

my images stored is in the shared folder \\191.128.5.296\Marina FileServer\E-Commerce_Share\Website Photo\All website photo

I want to get the image that matches name/code in column C and put, resize it in column D.
note that I have 1500 codes that need to be Matched with pictures

for example :
Code
AAG1045_1 in column B should match with picture name AAG1045_1 in the shared folder



can you please help with that



1636271555650.png
 
A hhh ! now I know my mistake. I'm really sorry about it. I thought the code deals with the files are existed in subfolders in directory . that's why it shows the error . your're right . it's not matched as in directly directory .
my apologies !
now all of your codes works based on what you explained.
thanks so much for your patience and time ;)
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
If possible, kindly can you add a button to clear the pictures after filling. so I can use it with different sheet in different situations
 
Upvote 0
If possible, kindly can you add a button to clear the pictures after filling. so I can use it with different sheet in different situations
VBA Code:
Public Sub Delete_All_Pictures()
    Dim i As Long
    For i = ActiveSheet.Pictures.Count To 1 Step -1
        If ActiveSheet.Pictures(i).Name Like "Picture*" Then
            ActiveSheet.Pictures(i).Delete
        End If
    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top