Hello Peter,
I've been successful in applying the guide from McGimpsey & Associates as per your reply. The test works ok when I use a new workbook and all is fine.
However, when I try to apply it to my live worksheet it is crashing at the line in the code that starts "For Each oPic In Me.Pictures". The error code is 13 and the msg is Type Mismatch. I have some other code in the worksheet code module and it appears to be tripping over this as my SelectionChange code now also fails.
Below is the code in my WorkSheet. If you have the time could you help me establish what is wrong. Have I done something wrong in inserting the code in the worksheet module.
Would appreciate your assistance.
Thanks, Peter
Regards,
Rick
This is all the code I have in the worksheet module.
'Private Sub ComboBox4_Change()
Option Explicit
Private Sub ComboBox4_Change()
Me.ComboBox4.Value = Format(Me.ComboBox4.Value, "00.00")
End Sub
Private Sub ComboBox5_Change()
'Me.ComboBox5.Value = Format(Me.ComboBox5.Value, "00.00")
End Sub
Private Sub ComboBox6_Change()
End Sub
Private Sub ListBox1_Click()
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Column = 10 And Target.Row > 11 And Target.Row < 24 Then
Range("J11").Value = Target.Value
End If
End Sub
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = True
With Range("F2")
For Each oPic In Me.Pictures 'Crashing Here....type mismatch
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub
bat17 said: