Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim p$, x%
If ActiveSheet.Pictures.Count Then ActiveSheet.Pictures.Delete
If Target.Count <> 1 Then End
If Target = "" Then End
If Target.Column <> 19 Then End
p = ThisWorkbook.Path & "\" & Target & ".jpg"
If Dir(p) <> "" Then
With ActiveSheet.Pictures.Insert(p)
.Left = Target.Left - .Width
Application.EnableEvents = False
x = Cells.SpecialCells(xlCellTypeLastCell).Row
Application.EnableEvents = True
If Target.Row < x / 2 Then
.Top = Target.Top + Target.Height
Else
.Top = Target.Top - .Height
End If
End With
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim p$, x%
If Target.Column = 19 And Target <> "" And Target.Count = 1 Then
If ActiveSheet.Pictures.Count Then ActiveSheet.Pictures.Delete
p = ThisWorkbook.Path & "\" & Target & ".jpg"
If Dir(p) <> "" Then
With ActiveSheet.Pictures.Insert(p)
.Left = Target.Left - .Width
Application.EnableEvents = False
x = Cells.SpecialCells(xlCellTypeLastCell).Row
Application.EnableEvents = True
If Target.Row < x / 2 Then
.Top = Target.Top
Else
.Top = Target.Top + Target.Height - .Height
End If
End With
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim p$, x%
If ActiveSheet.Pictures.Count Then ActiveSheet.Pictures.Delete
If Target.Count <> 1 Then End
If Target = "" Then End
If Target.Column <> 19 Then End
p = ThisWorkbook.Path & "\" & Target & ".jpg"
If Dir(p) <> "" Then
With ActiveSheet.Pictures.Insert(p)
.Left = Target.Left - .Width
Application.EnableEvents = False
x = Cells.SpecialCells(xlCellTypeLastCell).Row
Application.EnableEvents = True
If Target.Row < x / 2 Then
.Top = Target.Top + Target.Height
Else
.Top = Target.Top - .Height
End If
End With
End If
End Sub