Hey VBA-experts,
I have 144 pictures sorted in a matrix (6 by 24) on a User Form. I named theses pictures systematically so I can identify them easily based on their location. What I want to realize is, that if a picture is clicked on a function should be called, in which the image name should be used as parameter. However if I do that for each picture there is quite some manual work.
In the code you can see the example for Image4_2. From the name of the Image I would like to extract the two numbers and assign them to the row and seat variables. Is there a way to realize that? I tried the Me command, but that only refered to the Form itself instead to the image.
Thanks a lot for your help and time in advance.
Have a good day,
Konfis
Private Sub Image4_2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim BroSer As String
Dim Row As Integer
Dim Seat As Integer
Dim ImgStr As String
Row = 4
Seat = 2
ImgStr = "Image" & Row & "_" & Seat
BroSer = brokenservices(Row, Seat)
Me.Controls(ImgStr).ControlTipText = "Service(s) " & BroSer & " are not functional"
End Sub
Bookmarks