ajaypal_sp
New Member
- Joined
- Feb 11, 2015
- Messages
- 25
Hi,
I create basic Userform. In that, I want to load image based on Combobox / TextBox value. But image is not loading. Please go through the below code and Help me.
thank you for your help.
regards
I create basic Userform. In that, I want to load image based on Combobox / TextBox value. But image is not loading. Please go through the below code and Help me.
Code:
Private Sub cmbimg_Change() Me.TextBox1.Value = Application.WorksheetFunction.VLookup(Me.cmbimg.Value, xRg, 2, False)
End Sub
Private Sub UserForm_Activate()
ipath = "C:\Users\Ajay\Desktop\Fruit Images\"
On Error Resume Next
With Me.cmbimg.Value
Me.imgData.Picture = LoadPicture(Me.TextBox1.Text)
'Me.imgData.Picture = LoadPicture(ipath & Me.cmbimg.Value & ".JPG")
End With
End Sub
Private Sub UserForm_Initialize()
Dim xRg As Range
Set xRg = Worksheets("Sheet3").Range("A2:B33")
Me.cmbimg.List = xRg.Columns(1).Value
End Sub
thank you for your help.
regards