Private Sub Image2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
With ActiveSheet
If X < 10 Or X > Image2.Width - 10 Or Y < 10 Or Y > Image2.Height - 10 Then
ActiveSheet.Shapes("Basse-Normandie").Fill.ForeColor.RGB = RGB(255, 255, 255) 'Couleur de fond blanc
ActiveSheet.Shapes("Label5").Fill.ForeColor.RGB = RGB(255, 255, 0) 'Couleur de fond jaune
ActiveSheet.Shapes("Label5").Visible = False
ActiveSheet.Shapes("Label2").Fill.ForeColor.RGB = RGB(255, 255, 0) 'Couleur de fond jaune
ActiveSheet.Shapes("Label2").Visible = False
Else
ActiveSheet.Shapes("Label2").Visible = True
With ActiveSheet.Shapes("Label5")
.Visible = True
.TextFrame2.TextRange.Characters.Text = f("Basse-Normandie")
End With
ActiveSheet.Shapes("Basse-Normandie").Fill.ForeColor.RGB = RGB(0, 255, 0) 'Couleur de fond vert
End If
End With
End Sub
Private Function f(ByVal Str As String) As String
Dim c As Range
If Str <> "" Then
Set c = Worksheets("Donnée").Range("C:C").Find(Str, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
f = c.Offset(1, 0).Value
f = c.Offset(1, 1).Value
f = c.Offset(1, 2).Value
Set c = Nothing
End If
End If
End Function