paulman1976
New Member
- Joined
- Jun 26, 2013
- Messages
- 43
I have written a simple VBA Code in one workbook, that works well. However, if I am still in that workbook and open up a new workbook (which hasn't got any macros or VBA), I get the Runtime Error 9 message.
It highlights in the VBA Code the following line: If Sheets("IFAs").Range("F3").Value < 21 Then
The whole VBA Code is as follows:
Private Sub Worksheet_Calculate()
If Sheets("IFAs").Range("F3").Value < 21 Then
MsgBox "Need to Re-stock Brochures - Order now"
End If
If Sheets("IFAs").Range("G3").Value < 21 Then
MsgBox "Need to Re-stock A5 Enquiry Leaflets - Order now"
End If
End Sub
Can someone help as it is really annoying when I am still working within this file and need to open another one and the error message keeps popping up.
Many thanks.
Phil.
It highlights in the VBA Code the following line: If Sheets("IFAs").Range("F3").Value < 21 Then
The whole VBA Code is as follows:
Private Sub Worksheet_Calculate()
If Sheets("IFAs").Range("F3").Value < 21 Then
MsgBox "Need to Re-stock Brochures - Order now"
End If
If Sheets("IFAs").Range("G3").Value < 21 Then
MsgBox "Need to Re-stock A5 Enquiry Leaflets - Order now"
End If
End Sub
Can someone help as it is really annoying when I am still working within this file and need to open another one and the error message keeps popping up.
Many thanks.
Phil.