Data Validation for symbols

weefisheads

Active Member
Joined
Mar 18, 2006
Messages
353
I have a spreadsheet that creates a named file using data entered into a field. For a hypothetical example, people can put their favorite car in A2 and, when the macro is run, it will SAVE AS the spreadsheet and name it with the value of A2. Problem is, some folks don't follow instructions and do things like HONDA / INSIGHT, or else something using symbols that are not valid for file names. Bloody slashes!!

I know there are lots of ways to use Data Validation to prevent certain entries, but is there any way to prevent certain symbols? If not, can anyone help me with an Event Handler that would evaluate the data for certain symbols once the data is entered?

Many thanks for any help I can get...

dB
 
Thank you Tom. I've used the TRIM function for years and never discovered this interior facet of the function. I appreciate the clarification.


Two in a row. *sigh* I created that faulty pattern testing a few characters at time and found the ones that appeared to work in my mockup, it was a bad result based on quick tests.

The corrected version in post #7 with more knowledgeable syntax and function may have been, as your scolding emphasizes, too late. The OP did not respond to my corrected version.

As you don't understand the meaning of that function I wrote, it doesn't fufil OP's requirement.
 
Upvote 0

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