kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
I wanted to loop through this code :
So I tried the below:
Then I had some funny results. Only one image filled all the controls. Can somebody pull me out?
Regards
Kelly
Code:
Sheet1.Image1. Picture = LoadPicture (fPath & "\" & Sheet1. Range ("B2") & ".jpg")
Sheet1.Image2. Picture = LoadPicture (fPath & "\" & Sheet1. Range ("B12") & ".jpg")
Sheet1.Image3. Picture = LoadPicture (fPath & "\" & Sheet1. Range ("B22") & ".jpg")
........ to 20 controls
Code:
For x = 0 To 90 Step 10
For i = 1 To 20
Sheet1.OLEObjects ("Image" & i).Object. Picture = LoadPicture (fPath & "\" & Sheet1. Range ("B" & x + 2) & ".jpg")
Next i
Next x
Regards
Kelly