#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Data Validation

I require a Data Validation that will only allow up to 6 digits to be
inserted. This can only allow digits 1 - 9 as any one of the 6 digits.

I've tried Text Length, but that allows characters - / T etc

Any ideas?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Data Validation

Try this:
DataValidation
Allow: Whole Number
Between 111111 and 999999

Does that do what you want?

***********
Regards,
Ron


"John" wrote:

I require a Data Validation that will only allow up to 6 digits to be
inserted. This can only allow digits 1 - 9 as any one of the 6 digits.

I've tried Text Length, but that allows characters - / T etc

Any ideas?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sally
 
Posts: n/a
Default Data Validation

,If you need 6 digits you data validation allow: whole number data: between
minimum: 100,000 maximum: 999999. If less than 6 digits use less than
1,000,000
HTH
Sally
"John" wrote:

I require a Data Validation that will only allow up to 6 digits to be
inserted. This can only allow digits 1 - 9 as any one of the 6 digits.

I've tried Text Length, but that allows characters - / T etc

Any ideas?

Thanks



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default My prev doesn't work...maybe this

Set the Number format to TEXT
Set Data Validation to:
Category: Custom
Formula:
=AND(ISNUMBER(N(A1)),LEN(A1)<=6,ISERROR(FIND("0",A 1)),ISERROR(FIND(".",A1)),ISERROR(FIND("-",A1)),ISERROR(FIND("+",A1)),ISERROR(FIND("=",A1)) )

So far, that checks if:
the input is numeric
The length is 6 or less
There are no zeros, decimal points, plus or minus signs, or equal signs.

Just tack on anything else that violates your rules.

I hope that helps?

***********
Regards,
Ron


"Ron Coderre" wrote:

Try this:
DataValidation
Allow: Whole Number
Between 111111 and 999999

Does that do what you want?

***********
Regards,
Ron


"John" wrote:

I require a Data Validation that will only allow up to 6 digits to be
inserted. This can only allow digits 1 - 9 as any one of the 6 digits.

I've tried Text Length, but that allows characters - / T etc

Any ideas?

Thanks



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default more tweaking

The Data Validation formula should be:
=AND(ISNUMBER(--A1),LEN(A1)<=6,ISERROR(FIND("0",A1)),ISERROR(FIND( ".",A1)),ISERROR(FIND("-",A1)),ISERROR(FIND("+",A1)),ISERROR(FIND("=",A1)) )

Changed ISNUMBER(N(A1)) to ISNUMBER(--A1).
( ISNUMBER(N(A1)) allowed text )

After that, I'm out of ideas?

I hope that helps.

***********
Regards,
Ron


"Ron Coderre" wrote:

Set the Number format to TEXT
Set Data Validation to:
Category: Custom
Formula:
=AND(ISNUMBER(N(A1)),LEN(A1)<=6,ISERROR(FIND("0",A 1)),ISERROR(FIND(".",A1)),ISERROR(FIND("-",A1)),ISERROR(FIND("+",A1)),ISERROR(FIND("=",A1)) )

So far, that checks if:
the input is numeric
The length is 6 or less
There are no zeros, decimal points, plus or minus signs, or equal signs.

Just tack on anything else that violates your rules.

I hope that helps?

***********
Regards,
Ron


"Ron Coderre" wrote:

Try this:
DataValidation
Allow: Whole Number
Between 111111 and 999999

Does that do what you want?

***********
Regards,
Ron


"John" wrote:

I require a Data Validation that will only allow up to 6 digits to be
inserted. This can only allow digits 1 - 9 as any one of the 6 digits.

I've tried Text Length, but that allows characters - / T etc

Any ideas?

Thanks





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Data Validation

Thanks guys

Using Whole numbers between 1 - 999999 does the trick



"Sally" wrote in message
...
,If you need 6 digits you data validation allow: whole number data:
between
minimum: 100,000 maximum: 999999. If less than 6 digits use less than
1,000,000
HTH
Sally
"John" wrote:

I require a Data Validation that will only allow up to 6 digits to be
inserted. This can only allow digits 1 - 9 as any one of the 6 digits.

I've tried Text Length, but that allows characters - / T etc

Any ideas?

Thanks





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default more tweaking

Thanks Ron, you put a good deal of effort into your reply


"Ron Coderre" wrote in message
...
The Data Validation formula should be:
=AND(ISNUMBER(--A1),LEN(A1)<=6,ISERROR(FIND("0",A1)),ISERROR(FIND( ".",A1)),ISERROR(FIND("-",A1)),ISERROR(FIND("+",A1)),ISERROR(FIND("=",A1)) )

Changed ISNUMBER(N(A1)) to ISNUMBER(--A1).
( ISNUMBER(N(A1)) allowed text )

After that, I'm out of ideas?

I hope that helps.

***********
Regards,
Ron


"Ron Coderre" wrote:

Set the Number format to TEXT
Set Data Validation to:
Category: Custom
Formula:
=AND(ISNUMBER(N(A1)),LEN(A1)<=6,ISERROR(FIND("0",A 1)),ISERROR(FIND(".",A1)),ISERROR(FIND("-",A1)),ISERROR(FIND("+",A1)),ISERROR(FIND("=",A1)) )

So far, that checks if:
the input is numeric
The length is 6 or less
There are no zeros, decimal points, plus or minus signs, or equal signs.

Just tack on anything else that violates your rules.

I hope that helps?

***********
Regards,
Ron


"Ron Coderre" wrote:

Try this:
DataValidation
Allow: Whole Number
Between 111111 and 999999

Does that do what you want?

***********
Regards,
Ron


"John" wrote:

I require a Data Validation that will only allow up to 6 digits to be
inserted. This can only allow digits 1 - 9 as any one of the 6
digits.

I've tried Text Length, but that allows characters - / T etc

Any ideas?

Thanks





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
From several workbooks onto one excel worksheet steve Excel Discussion (Misc queries) 6 December 1st 05 08:03 AM
Data Validation Kosta S Excel Worksheet Functions 2 July 17th 05 11:38 PM
data validation lists [email protected] Excel Discussion (Misc queries) 5 June 25th 05 07:44 PM
named range, data validation: list non-selected items, and new added items KR Excel Discussion (Misc queries) 1 June 24th 05 05:21 AM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 05:55 PM


All times are GMT +1. The time now is 12:30 PM.

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

About Us

"It's about Microsoft Excel"