kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Hello All,
I need help to figure out what I am doing wrongly here:
I wanna load image control on my worksheet with this script but I think i am doing something wrongly since I can't get the result.
This line worked but I want to get it work with the worksheet:
I want to load the image each time I change the value in the cell H9 on the Sheet2. I wish this is possible.
Thanks
Kelly
I need help to figure out what I am doing wrongly here:
I wanna load image control on my worksheet with this script but I think i am doing something wrongly since I can't get the result.
Code:
Sub ShowPic ()
Dim fPath As String, sFile As String
On Error resume next
fPath = ThisWorkbook.Path & "\" & Me.CmbTerm.Text
sFile = Dir (fPath & "/" & Right (Sheet2.Range("H9").Text, 3) & ".*")
If sFile <> vbNullString Then
Sheet2.Image1.Picture = LoadPicture(fPath & "\" & sFile )
Else
Sheet2.Image1.Picture = LoadPicture ("")
End If
If Err 53 Then
Sheet2.Image1.Picture = LoadPicture ("")
End If
On Error GoTo 0
End Sub
This line worked but I want to get it work with the worksheet:
Code:
i = Me.lstView.ListIndex
sFile = Dir (fPath & "/" & Right (Me.lstView.Column(4 , i).Text, 3) & ".*")
I want to load the image each time I change the value in the cell H9 on the Sheet2. I wish this is possible.
Thanks
Kelly