Posted to microsoft.public.excel.programming
|
|
Worksheet_Change Event Not Working
Chip, Tom,
Many thanks for your help. All seems to be working OK now.
"Tom Ogilvy" wrote in message
...
The code Chip Provided should go in the Sheet module where you want the
behavior. Right click on the sheet tab and select view code. Paste in
Chip's code.
Regards,
Tom Ogilvy
"Chip Pearson" wrote in message
...
Michael,
Try something like the following:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$14" Then
If IsNumeric(Target) Then
MsgBox ("Enter your comments here")
Application.EnableEvents = False
Target.ClearContents
Target.Select
Application.EnableEvents = True
End If
End If
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Michael Beckinsale" wrote in
message ...
Hi,
I have written the following code and tried placing it in a
Module,
ThisWorkbook and Sheet1 and it will not work at all. Can abybody
tell me
what l am doing wrong ?
I want to stop the using entering numeric values in the cell B14
of Sheet1.
When l get the procedure to work l will want it to work on a
merged cell
range and then call a subroutine.
Anty help greatly appreciated.
Regards
Michael Beckinsale
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$14" Then
If IsNumeric(Target) Then
MsgBox ("Enter your comments here")
Range(Target).ClearContents
End If
End If
End Sub
|