Jeevan
Jeevan

Reputation: 477

Excel VBA: Worksheet_Change method not working inside my Module

In my module I added a method.

Private Sub Worksheet_Change(ByVal Target As Range)
    Debug.Print "H"
End Sub

I have two tables in that sheet. I try to enter values inside one table but this subroutine is not getting executed. What is wrong here?

I have a table, where I need to allow entering a value inside a cell only if another cell of the same row have a particular value? Is there a better way to do that?

enter image description here

Thanks Jeevan

Upvotes: 1

Views: 1029

Answers (1)

Rosetta
Rosetta

Reputation: 2725

Put it inside the sheet module and not the module module

enter image description here

Just additional info, in the sheet module you can find the list of EventListerners available from the drop down menu too. These are not available in a module module.

enter image description here

Upvotes: 4

Related Questions