1

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

3
  • Check if events are enabled for that to work or you can do it by Application.EnableEvents = True. Did you check the Immediate Window whether it works or not ? Commented Aug 23, 2016 at 10:02
  • You have added it to a worksheet module and not a normal or class module? Commented Aug 23, 2016 at 10:04
  • Yes I checked Immediate Window. I never made Application.EnableEvents = False anywhere. I added it in normal module, which comes under the hierarchy "Modules". Commented Aug 23, 2016 at 10:06

1 Answer 1

4

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

Sign up to request clarification or add additional context in comments.

3 Comments

How can I add an Event for a particular module alone?
@Jeevan you can create the EventListener in a sheet module to call a procedure in a module module.
I shall search for EventListener and try to figure out how to do that. Thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.