Hi all,
I use the code below to see pictures one by one. In sheet 1, at cell A2 I enter a value, and a picture related to this value becomes visible on cell F1. The problem is, I want to add some autocad drawings to the sheet. But when I replace a picture with an autocad drawing, the code gives "type mismatch" error for it. Is there a way to repair the code, so that it can process autocad drawings also?
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub
Bookmarks