Run code on data validation

npacker

Board Regular
Joined
Oct 14, 2004
Messages
132
Is there a way to have a piece of code run when a data validation meets certain criteria? I've got a data validation that puts up an info box when a user puts more thatn 1024 characters in a cell. Can I have it run some code at that time? Or is there a better way to have some code run as soon as more than 1024 characters are typed in any cell?
Thanks,
nate
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I would probably use the worksheet changed event to trap inputs and then examine target.value to see what they had input - if you need help on creating event handlers let me know
 
Upvote 0
You can use the worksheet's _Change() event handler for this type of thing. But note that it only fires after the user has hit the Enter key. There is no way to run a macro while a user is in Edit mode (while they're typing).
 
Upvote 0

Forum statistics

Threads
1,203,096
Messages
6,053,510
Members
444,668
Latest member
OneCat

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