ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run procedure in stored in module on worksheet change event (https://www.excelbanter.com/excel-programming/431806-run-procedure-stored-module-worksheet-change-event.html)

Daniel Jones

Run procedure in stored in module on worksheet change event
 
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

Mike H

Run procedure in stored in module on worksheet change event
 
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

"Daniel Jones" wrote:

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


Daniel Jones

Run procedure in stored in module on worksheet change event
 
On Jul 30, 12:55*pm, Mike H wrote:
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

"Daniel Jones" wrote:
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


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

Jim Thomlinson

Run procedure in stored in module on worksheet change event
 
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?
--
HTH...

Jim Thomlinson


"Daniel Jones" wrote:

On Jul 30, 12:55 pm, Mike H wrote:
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

"Daniel Jones" wrote:
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


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


Susan

Run procedure in stored in module on worksheet change event
 
just a thought (cuz it happened to me!) - Target.Address is case
sensitive.
$j$1 won't trigger.
:)
susan


On Jul 30, 1:02*pm, Daniel Jones wrote:
On Jul 30, 12:55*pm, Mike H wrote:





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


"Daniel Jones" wrote:
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


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- Hide quoted text -

- Show quoted text -



Daniel Jones

Run procedure in stored in module on worksheet change event
 
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

On Jul 30, 1:58*pm, Susan wrote:
just a thought (cuz it happened to me!) - Target.Address is case
sensitive.
$j$1 won't trigger.
:)
susan

On Jul 30, 1:02*pm, Daniel Jones wrote:



On Jul 30, 12:55*pm, Mike H wrote:


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


"Daniel Jones" wrote:
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


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- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com