muhammad susanto
Well-known Member
- Joined
- Jan 8, 2013
- Messages
- 2,102
- Office Version
- 365
- 2021
- Platform
- Windows
hi all...
i have vba code to insert picture into a cell...this code work properly but i want this code can "looking for" a folder that contains images..
Before it, i must change that path/location every time to set locate folder if i change my photos..
here this code :
how to make that code not change manually typing path/location ..i want the code work like can "browse" a folder that i want it..
for everyone would help me, greatly appreciated...
.sst
i have vba code to insert picture into a cell...this code work properly but i want this code can "looking for" a folder that contains images..
Before it, i must change that path/location every time to set locate folder if i change my photos..
here this code :
Code:
Sub ReplaceImages()
If Range("AM8") = "" Then Exit Sub
Dim MyPic As String
For i = 1 To 4
MyPic = [COLOR=#ff0000]"d:\myfotos[/COLOR]\" & Range("AM8").Value & ".jpg"
With Me.Shapes("Pic_" & i).Fill
.Visible = msoTrue
On Error Resume Next
.UserPicture MyPic
End With
Next i
End Sub
Private Sub CommandButton1_Click()
ReplaceImages
End Sub
how to make that code not change manually typing path/location ..i want the code work like can "browse" a folder that i want it..
for everyone would help me, greatly appreciated...
.sst
Last edited: