Event procedure debug error

RattlingCarp3048

Board Regular
Joined
Jan 12, 2022
Messages
166
Office Version
  1. 365
Platform
  1. Windows
I have an event procedure that basically says if column D changes show me a message box. so why is it when i insert a column or row anywhere in the document i get this error message? at the moment trying to insert a new column between Y-Z and keep getting this error when it has nothing to do with column D.

1646851575429.png


1646851604293.png
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
it has nothing to do with column D.
No, but it has something to do with the entire row. Also the code will check ALL criteria on that line, which will always give an error if more then one cell is changed.
Try adding this as the first line of code
VBA Code:
   If Target.CountLarge > 1 Then Exit Sub
 
Upvote 0
Solution
No, but it has something to do with the entire row. Also the code will check ALL criteria on that line, which will always give an error if more then one cell is changed.
Try adding this as the first line of code
VBA Code:
   If Target.CountLarge > 1 Then Exit Sub
That worked. i havent seen that line before. what is saying?
 
Upvote 0
It sayd if more than one cell is changed, then exit the sub.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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