Run procedure in stored in module on worksheet change event

D

Daniel Jones

Guys-

Is there a way to run a procedure thats stored in a module on a
worksheet change event? When cell J1 changes, I'd like to run the
procedure ChangeRows() which is stored in a module. However, this
does not seem to be calling the procedure. Can anyone help? Thanks!


Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address

Comment here
Case "$J$1"

Call ChangeRows

Case Else
End Select
End Sub
 
M

Mike H

Daniel,

Try it like this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$J$1" Then

Call ChangeRows

End If
End Sub

Mike
 
D

Daniel Jones

Daniel,

Try it like this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$J$1" Then

Call ChangeRows

End If
End Sub

Mike

Thank you, I actually tried that too, and that doesn't work either.
For some reason, its just not calling ChangeRows and I'm not sure
why. Can anyone solve the mystery? Thanks!

D
 
J

Jim Thomlinson

Does your code compile? Have you stepped through the code with F8 to see what
is going on? Do you have a break point / message box to ensure that the
change code is being called at all?
 
S

Susan

just a thought (cuz it happened to me!) - Target.Address is case
sensitive.
$j$1 won't trigger.
:)
susan
 
D

Daniel Jones

Jim-

I did try most of those debugging steps. I think it has to do with
another add-in that was trying to run when the worksheet was changed.
I tried this on a blank worksheet where the add-in was not being used
and it worked fine. Thanks for your help!

Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top