VBA - intersect target does not fire upon change event

chistos

New Member
Joined
Oct 10, 2020
Messages
8
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I am working on macro which operates with ranges and when range is change, event is fired problem is that intersext target stop firying, it work on part of macro and it does not work on second part. code bellow, same code run just fine on other parts of sheet and here it does not.

Code.PNG
Caode2PNG.PNG
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
If the code has been stopped at some point, you may need to reset
Application.enableEvents back to true by using the Immediates window !!
Simply type it into the immediates window and press Enter.
 
Upvote 0
What kind of variable is range29to30e within the first line of code?
In case it's a named range it should probably be (note the double quotes...)
VBA Code:
If Intersect(Target, Range("range29ti30e")) Is Nothing Then
 
Upvote 0
If the code has been stopped at some point, you may need to reset
Application.enableEvents back to true by using the Immediates window !!
Simply type it into the immediates window and press Enter.
Will not fix an issue, because it is created for users, who does not know what is immediate window, any idea how to reset? Because actually it is sheet where user choose answer from list and according to that answer new ines pop up or not...
 
Upvote 0
What kind of variable is range29to30e within the first line of code?
In case it's a named range it should probably be (note the double quotes...)
VBA Code:
If Intersect(Target, Range("range29ti30e")) Is Nothing Then
Set range29to30e = Range(Quest29.Offset(1, 0).Address, Quest31.Offset(-1, 0).Address)

this is the variable sources are
Set Quest29 = Cells.Find(What:="We included and signed-off all audit evidence in Canvas before the audit report date.", After:=Range("A1"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns, MatchCase:=True).Offset(0, 1)
 
Upvote 0
Set range29to30e = Range(Quest29.Offset(1, 0).Address, Quest31.Offset(-1, 0).Address)
With the above code the line below
VBA Code:
If Intersect(Target, Range(range29ti30e)) Is Nothing Then
should give you a run-time error (at least in the version I am using ....) Try replacing it with ...
VBA Code:
If Intersect(Target, range29ti30e) Is Nothing Then
 
Upvote 0
With the above code the line below
VBA Code:
If Intersect(Target, Range(range29ti30e)) Is Nothing Then
should give you a run-time error (at least in the version I am using ....) Try replacing it with ...
VBA Code:
If Intersect(Target, range29ti30e) Is Nothing Then
Looks like it helps and code is running, thanks you lot
 
Upvote 0
You are welcome and thanks for letting us know.
 
Upvote 0

Forum statistics

Threads
1,215,663
Messages
6,126,097
Members
449,291
Latest member
atfoley16

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