goncalocoelho
New Member
- Joined
- Apr 15, 2020
- Messages
- 9
- Office Version
- 2016
- Platform
- Windows
Hi!
I'm currently having some questions on how to make this work without having my VBA code to loadpictures from an external file.
I have set and Active X control Image to display different pictures according to a cell value. I would like to know if its possible to make the image box display pictures that are already in my excel sheet without it having to specify a LoadPicture command with an path to a file. My idea is having a hidden sheet with all the pictures i needed.
I'm currently having some questions on how to make this work without having my VBA code to loadpictures from an external file.
I have set and Active X control Image to display different pictures according to a cell value. I would like to know if its possible to make the image box display pictures that are already in my excel sheet without it having to specify a LoadPicture command with an path to a file. My idea is having a hidden sheet with all the pictures i needed.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$2" Then
If Folha4.Range(Target.Address) = "Option1" Then
Folha4.Image1.Picture = LoadPicture("path")
If Folha4.Range(Target.Address) = "Option2" Then
Folha4.Image1.Picture = LoadPicture("path")
End If
End If
End Sub