Cambiar imagen en label1 al mover el mouse sobre un botón
Espero si me ayuden
Tengo este código:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error GoTo control If Not Intersect(Target, Range("C6:C158")) Is Nothing Then ruta = ActiveWorkbook.Path & "\carpetadeimagenes\" & Target & ".jpg" Image1.Picture = LoadPicture(ruta) Image1.PictureSizeMode = fmPictureSizeModeStretch End If Exit Sub control: Image1.Picture = Nothing Resume Next End Sub
que cambia la imagen al pasar sobre el rango, entonces quisiera
poner un codigo asi pero en un label, no se si se pueda
Que al pasar por el boton1 la imagen del label1 cambie, al pasar por el boton2 vuelva a cambiar y así
Con la diferencia que la imagen no estará en un carpeta aparte si no dentro del libro ya estará insertado (esto para la búsqueda) algo así:
Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) On Error GoTo control If Not Intersect(Label1.Caption) Is Nothing Then ruta = "imagen1" Label1.Caption = LoadPicture(ruta) Label1.Caption = fmPictureSizeModeStretch End If Exit Sub control: Label1.Caption = Nothing Resume Next End Sub