Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Data Validation - Allow numbers, comma, - and space

On Apr 28, 11:56*am, Ken Johnson wrote:
Hi,

If A UDF is not allowed then the following seems to work…

F8 on Sheet1 needing validation. On a spare sheet (I used Sheet3) in
A1 enter a string consisting of all the allowable characters. In this
case…

", -1234567890"

in A2 on the spare sheet enter the following formula...

=IF(MID(Sheet1!$F$8,ROWS($A$2:$A2),1)="","BLANK",M ID(Sheet1!$F
$8,ROWS($A$2:$A2),1))

In B2 on the spare sheet enter this formula...

=IF(A2="BLANK",0,IF(ISERROR(FIND(A2,$A$1)),0,--(FIND(A2,$A$1)0)))

Fill the formulas in A2 and B2 down so that the number of rows with
the formulas is not less than the number of characters in the longest
possible string to be entered into F8. (I filled down to row 31).

In B1 on the spare sheet enter the following formula...

=IF(SUM(B2:B31)=LEN(Sheet1!F8),TRUE,FALSE)

With B1 selected go Insert|Name|Define... then type
"IsF8Valid" (without the speech marks) into the Name box. Click Add
then OK.

Select F8 then apply the data validation using "=IsF8Valid" (without
the speech marks) as the Custom Formula.

Ken Johnson


Hello

Thanks everyone for your help ... Solution given by Ken J UDF works
perfect!!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
add extra space before comma clarknv Excel Worksheet Functions 6 March 19th 07 03:52 PM
Inserting a space after a comma Visual Calendar Dilemma Excel Worksheet Functions 2 September 11th 06 11:20 PM
Show comma in data validation list? [email protected] Excel Discussion (Misc queries) 7 May 17th 05 02:07 AM
Removing a space after a comma DebbieK9 New Users to Excel 3 April 1st 05 10:08 PM
HELP - I need to change space delimited to comma? Mayer Excel Discussion (Misc queries) 1 December 18th 04 06:21 PM


All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"