kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Hello all,
I need help with how to use multiple with in a procedure. I want to use them to reference Worksheets. So say I have four sheets .
So from the above code, I want them run on sheets 2 3 and 4. But I don't want separate procedures for them.
Regards
Kelly
I need help with how to use multiple with in a procedure. I want to use them to reference Worksheets. So say I have four sheets .
Code:
For i = 1 To 20
With Sheet1
.OLEObjects("Image" & i).Object.Picture = LoadPicture(fPath & "\" & .Cells(10 * i - 8, "B") & ".jpg")
.OLEObjects("Image" & i + 10).Object.Picture = LoadPicture(fPath & "\" & .Cells(10 * i - 8, "F") & ".jpg")
End With
Next i
So from the above code, I want them run on sheets 2 3 and 4. But I don't want separate procedures for them.
Regards
Kelly