View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Don Lloyd Don Lloyd is offline
external usenet poster
 
Posts: 28
Default Event: Workbook_Change or Worksheet_Change

Worksheet_Change should work fine.
With WorkBook_SheetChange the code runs every time you change ANY worksheet.

Don.
"Han" wrote in message
ups.com...
Thank you both for your input. I forgot that it's not Workbook_Change,
but Workbook_SheetChange. Although, it does not explain why
Worksheet_Change didn't do anything. No matter, I will be using the
Workbook_SheetChange event.
--------------------------------------------------------------------
Just in case someone reads this later on, the parameter "ByVal Sh As
Object" is mandatory for the Workbook_SheetChange event. I receive a
compile error if it is not included. My final working code looks like
this:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)

If Target.Column < 19 Then Exit Sub
If Cells(Target.Row, Target.Column).Value = "B" Then
MsgBox "OMG! It works!"
End If

End Sub

Once again, thank you for you input!