View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John Keith[_2_] John Keith[_2_] is offline
external usenet poster
 
Posts: 175
Default Checking for Invalid filename characters

I am attempting to create a Data Validation formula to test an input cell to
make sure that it can be used to automatically assign a file name.

I tried putting the Data Validation "custom" formula attached to cell B2,
but all text comes back as invalid.
InStr(B2,"?"&Chr(34)&"/\<*|:")=0

Any ideas on why this fails?

I.E.
" used here to show the string limits... not part of the actual string,
although Chr(34) would be an invalid filename character in the InStr above.
"Test" in the cell SHOULD be valid
"Test<1" SHOULD NOT be valid
--
Regards,
John