Code suddenly stopped working

Corleone

Well-known Member
Joined
Feb 2, 2003
Messages
841
Office Version
  1. 365
I have a series of macros which run when the user toggles between either Y or N in a dropdown on the sheet.

for some reason these macro have become unresponsive

I have completely closed excel down and re-opened it to no avail

Do I need to add a command in the "Immediate Box"

Thanks



Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
If Intersect(Target, Range("J3:J32")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
For Each cell In Selection
Select Case cell.Address(False, False) & cell.Value
Case "J3" & "Y": Call Show_GRAPH01
Case "J3" & "N": Call Hide_GRAPH01
Case "J4" & "Y": Call Show_GRAPH02
Case "J4" & "N": Call Hide_GRAPH02
Case "J5" & "Y": Call Show_GRAPH03
Case "J5" & "N": Call Hide_GRAPH03
Case "J6" & "Y": Call Show_GRAPH04
Case "J6" & "N": Call Hide_GRAPH04
Case "J7" & "Y": Call Show_GRAPH05
Case "J7" & "N": Call Hide_GRAPH05
Case "J8" & "Y": Call Show_GRAPH06
Case "J8" & "N": Call Hide_GRAPH06
Case "J9" & "Y": Call Show_GRAPH07
Case "J9" & "N": Call Hide_GRAPH07
Case "J10" & "Y": Call Show_GRAPH08
Case "J10" & "N": Call Hide_GRAPH08
Case "J11" & "Y": Call Show_GRAPH09
Case "J11" & "N": Call Hide_GRAPH09
Case "J12" & "Y": Call Show_GRAPH10
Case "J12" & "N": Call Hide_GRAPH10
Case "J13" & "Y": Call Show_GRAPH11
Case "J13" & "N": Call Hide_GRAPH11
Case "J14" & "Y": Call Show_GRAPH12
Case "J14" & "N": Call Hide_GRAPH12
Case "J15" & "Y": Call Show_GRAPH13
Case "J15" & "N": Call Hide_GRAPH13
Case "J16" & "Y": Call Show_GRAPH14
Case "J16" & "N": Call Hide_GRAPH14
Case "J17" & "Y": Call Show_GRAPH15
Case "J17" & "N": Call Hide_GRAPH15
Case "J18" & "Y": Call Show_GRAPH16
Case "J18" & "N": Call Hide_GRAPH16
Case "J19" & "Y": Call Show_GRAPH17
Case "J19" & "N": Call Hide_GRAPH17
Case "J20" & "Y": Call Show_GRAPH18
Case "J20" & "N": Call Hide_GRAPH18
Case "J21" & "Y": Call Show_GRAPH19
Case "J21" & "N": Call Hide_GRAPH19
Case "J22" & "Y": Call Show_GRAPH20
Case "J22" & "N": Call Hide_GRAPH20
Case "J23" & "Y": Call Show_GRAPH21
Case "J23" & "N": Call Hide_GRAPH21
Case "J24" & "Y": Call Show_GRAPH22
Case "J24" & "N": Call Hide_GRAPH22
Case "J25" & "Y": Call Show_GRAPH23
Case "J25" & "N": Call Hide_GRAPH23
Case "J26" & "Y": Call Show_GRAPH24
Case "J26" & "N": Call Hide_GRAPH24
Case "J27" & "Y": Call Show_GRAPH25
Case "J27" & "N": Call Hide_GRAPH25
Case "J28" & "Y": Call Show_GRAPH26
Case "J28" & "N": Call Hide_GRAPH26
Case "J29" & "Y": Call Show_GRAPH27
Case "J29" & "N": Call Hide_GRAPH27
Case "J30" & "Y": Call Show_GRAPH28
Case "J30" & "N": Call Hide_GRAPH28
Case "J31" & "Y": Call Show_GRAPH29
Case "J31" & "N": Call Hide_GRAPH29
Case "J32" & "Y": Call Show_GRAPH30
Case "J32" & "N": Call Hide_GRAPH30






End Select
Next cell
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
try putting a stop point (F9) on the 1st line, IF INTERSECT...
run the macro,
the code will stop here and you can step thru, F8 , 1 line at a time to see whats working.
 
Upvote 0
Thanks for the response
The macros themselves work fine but for some reason they are no longer being activated when I select y or n in the relevant cells

I think it's something to to with the application.event=True not working but can't quite figure it out

As it has always worked in the past
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,198
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top