#1   Report Post  
Posted to microsoft.public.excel.misc
grahammal
 
Posts: n/a
Default Cell Formatting


How can I format a cell so that it will only allow seven digits to be
entered.
It must not allow less or more than seven.


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=521479

  #2   Report Post  
Posted to microsoft.public.excel.misc
Paul Lautman
 
Posts: n/a
Default Cell Formatting

grahammal wrote:
How can I format a cell so that it will only allow seven digits to be
entered.
It must not allow less or more than seven.


Can the number have leading zeros?


  #3   Report Post  
Posted to microsoft.public.excel.misc
grahammal
 
Posts: n/a
Default Cell Formatting


The number will never have leading zero's.
As far as I can tell it will always begin with a 5.
Examples
5393276
5393312
5393331
5393454


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=521479

  #4   Report Post  
Posted to microsoft.public.excel.misc
Paul Lautman
 
Posts: n/a
Default Cell Formatting

grahammal wrote:
The number will never have leading zero's.
As far as I can tell it will always begin with a 5.
Examples
5393276
5393312
5393331
5393454


In that case you can change the formula in step 8 of my other post to:
=AND(ISNUMBER(F8),(LEN(F8)=7))
and leave out steps 2 to 5 inclusive.

Enjoy!!


  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Cell Formatting

One more...

Whole Number
Between:
Minimum:
5000000
Maximum:
5999999



grahammal wrote:

The number will never have leading zero's.
As far as I can tell it will always begin with a 5.
Examples
5393276
5393312
5393331
5393454

--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=521479


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
Paul Lautman
 
Posts: n/a
Default Cell Formatting

Dave Peterson wrote:
One more...

Whole Number
Between:
Minimum:
5000000
Maximum:
5999999

But he isn't SURE that it always begins with 5.


  #7   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Cell Formatting

But he is sure as far as he can tell.

Which is probably the best any of us can say about anything.

Paul Lautman wrote:

Dave Peterson wrote:
One more...

Whole Number
Between:
Minimum:
5000000
Maximum:
5999999

But he isn't SURE that it always begins with 5.


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
jamex
 
Posts: n/a
Default Cell Formatting


I think no such format is available to restrict a cell to accept only 7
alphabets, but validation can restrict it:

Data-Validation
Allow=Text length
Data=Equal to
length=7
click ok

Now just type any seven alphabets in your active cell.

Cheers...Jamex


--
jamex
------------------------------------------------------------------------
jamex's Profile: http://www.excelforum.com/member.php...o&userid=32243
View this thread: http://www.excelforum.com/showthread...hreadid=521479

  #9   Report Post  
Posted to microsoft.public.excel.misc
Paul Lautman
 
Posts: n/a
Default Cell Formatting

jamex wrote:
I think no such format is available to restrict a cell to accept only
7 alphabets, but validation can restrict it:

Data-Validation
Allow=Text length
Data=Equal to
length=7
click ok

Now just type any seven alphabets in your active cell.

Cheers...Jamex


The requirement was for digits not alpha-numeric.


  #10   Report Post  
Posted to microsoft.public.excel.misc
Jim May
 
Posts: n/a
Default Cell Formatting

Using the Allow: Text length
seems to not exclude numbers,
although the use of the word text
suggests so,,

Jim

"jamex" wrote in
message ...

I think no such format is available to restrict a cell to accept only 7
alphabets, but validation can restrict it:

Data-Validation
Allow=Text length
Data=Equal to
length=7
click ok

Now just type any seven alphabets in your active cell.

Cheers...Jamex


--
jamex
------------------------------------------------------------------------
jamex's Profile:
http://www.excelforum.com/member.php...o&userid=32243
View this thread: http://www.excelforum.com/showthread...hreadid=521479





  #11   Report Post  
Posted to microsoft.public.excel.misc
Paul Lautman
 
Posts: n/a
Default Cell Formatting

grahammal wrote:
How can I format a cell so that it will only allow seven digits to be
entered.
It must not allow less or more than seven.


Assuming that leading zeros are allowed/expected:

1) Select the cell
2) Press Ctrl-1
3) On the Number tab select Custom
4) In the Type box type 0000000
5) Click OK
6) Go to Data-Validation
7) On the Settings tab select Allow Custom
8) Assuming that the cell in question is F8 in the Formula box type:
=AND(ISNUMBER(F8),(LEN(TEXT(F8,"0000000"))=7))
9) Click OK


  #12   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Cell Formatting

Use Data Validation with a type of whole number and values of 1111111 and
9999999

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"grahammal" wrote in
message ...

How can I format a cell so that it will only allow seven digits to be
entered.
It must not allow less or more than seven.


--
grahammal
------------------------------------------------------------------------
grahammal's Profile:

http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=521479



  #13   Report Post  
Posted to microsoft.public.excel.misc
Paul Lautman
 
Posts: n/a
Default Cell Formatting

Bob Phillips wrote:
Use Data Validation with a type of whole number and values of 1111111
and 9999999

Surely it'd need to be 1000000 to 9999999 otherwise 1023456 for instance
would not be valid.


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
Conditional Formatting For A Cell Other Than The One With The Form Jim J. Excel Worksheet Functions 2 February 19th 06 07:11 PM
Drop Down List that has formatting of cell range Font ect. Tom Meacham Excel Discussion (Misc queries) 1 January 11th 06 01:43 AM
can conditional formatting on one cell value to another cell valu Ring eye Excel Worksheet Functions 2 January 10th 06 07:32 PM
Transfer Cell Formatting for linked cells Scott Excel Discussion (Misc queries) 2 November 23rd 05 11:04 PM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM


All times are GMT +1. The time now is 09:20 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"