Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Data I have Excel 2002 as part of Office XP Standard. I tried alidation, I think

I need to ensure that users only enter a customer number in the correct
format in a cell.

The format is an 'A' followed by 7 numbers.

How can I use validation to ensure only this type of entry is allowed?

Gareth


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Data I have Excel 2002 as part of Office XP Standard. I tried alidation, I think

Gareth,

For Data Validation (either manual or by code).
Set "Allow:" to "Custom"

In the "Formula:" box put
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a")
(this is for cell A1, adjust as needed)
change to
=AND(LEN(A1)=8,A1="A")
to accept only capital A

In code it would look something like this
With Selection.Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, _
Operator:= _
xlBetween, Formula1:="=AND(LEN(E1)=8,E1:E1=""A"")"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

[you can remove or amend most of the lines after the formula part]

hth

--
sb
"Gareth" wrote in message
...
I need to ensure that users only enter a customer number in the correct
format in a cell.

The format is an 'A' followed by 7 numbers.

How can I use validation to ensure only this type of entry is allowed?

Gareth




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Data I have Excel 2002 as part of Office XP Standard. I tried alidation, I think

Steve

Cannot seem to get it to work, I can see what LEN does and what LEFT(A1,1)
does but it doesn't work.

Also, is it possible to ensure that the last 7 characters are numerical?

Gareth
"steve" wrote in message
...
Gareth,

For Data Validation (either manual or by code).
Set "Allow:" to "Custom"

In the "Formula:" box put
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a")
(this is for cell A1, adjust as needed)
change to
=AND(LEN(A1)=8,A1="A")
to accept only capital A

In code it would look something like this
With Selection.Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, _
Operator:= _
xlBetween, Formula1:="=AND(LEN(E1)=8,E1:E1=""A"")"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

[you can remove or amend most of the lines after the formula part]

hth

--
sb
"Gareth" wrote in message
...
I need to ensure that users only enter a customer number in the correct
format in a cell.

The format is an 'A' followed by 7 numbers.

How can I use validation to ensure only this type of entry is allowed?

Gareth






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Data I have Excel 2002 as part of Office XP Standard. I tried alidation, I think

Tom,

Thanks for pointing me to "ISNUMBER". I was getting ready to suggest
an event macro.

A further mod would be to use "VALUE" instead of "*1".
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(VALU E(RIGHT(A1,7)))

[watch word wrap]
--
sb
"Tom Ogilvy" wrote in message
...
Steve's suggestion worked for me. did you select A1 and then do
Data=Validation, select custom and paste in the formula?

Here is a modification to restrict the last 7 to numbers:

=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(RIGH T(A1,7)*1))

--
Regards,
Tom Ogilvy

"Gareth" wrote in message
...
Steve

Cannot seem to get it to work, I can see what LEN does and what

LEFT(A1,1)
does but it doesn't work.

Also, is it possible to ensure that the last 7 characters are numerical?

Gareth
"steve" wrote in message
...
Gareth,

For Data Validation (either manual or by code).
Set "Allow:" to "Custom"

In the "Formula:" box put
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a")
(this is for cell A1, adjust as needed)
change to
=AND(LEN(A1)=8,A1="A")
to accept only capital A

In code it would look something like this
With Selection.Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, _
Operator:= _
xlBetween, Formula1:="=AND(LEN(E1)=8,E1:E1=""A"")"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

[you can remove or amend most of the lines after the formula part]

hth

--
sb
"Gareth" wrote in message
...
I need to ensure that users only enter a customer number in the

correct
format in a cell.

The format is an 'A' followed by 7 numbers.

How can I use validation to ensure only this type of entry is

allowed?

Gareth










  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Data I have Excel 2002 as part of Office XP Standard. I tried alidation, I think

Tom and steve

it still allows me to enter a small 'a'

Gareth

"steve" wrote in message
...
Tom,

Thanks for pointing me to "ISNUMBER". I was getting ready to suggest
an event macro.

A further mod would be to use "VALUE" instead of "*1".
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(VALU E(RIGHT(A1,7)))

[watch word wrap]
--
sb
"Tom Ogilvy" wrote in message
...
Steve's suggestion worked for me. did you select A1 and then do
Data=Validation, select custom and paste in the formula?

Here is a modification to restrict the last 7 to numbers:

=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(RIGH T(A1,7)*1))

--
Regards,
Tom Ogilvy

"Gareth" wrote in message
...
Steve

Cannot seem to get it to work, I can see what LEN does and what

LEFT(A1,1)
does but it doesn't work.

Also, is it possible to ensure that the last 7 characters are

numerical?

Gareth
"steve" wrote in message
...
Gareth,

For Data Validation (either manual or by code).
Set "Allow:" to "Custom"

In the "Formula:" box put
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a")
(this is for cell A1, adjust as needed)
change to
=AND(LEN(A1)=8,A1="A")
to accept only capital A

In code it would look something like this
With Selection.Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, _
Operator:= _
xlBetween, Formula1:="=AND(LEN(E1)=8,E1:E1=""A"")"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

[you can remove or amend most of the lines after the formula part]

hth

--
sb
"Gareth" wrote in message
...
I need to ensure that users only enter a customer number in the

correct
format in a cell.

The format is an 'A' followed by 7 numbers.

How can I use validation to ensure only this type of entry is

allowed?

Gareth














  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Data I have Excel 2002 as part of Office XP Standard. I tried alidation, I think

Gareth,

To restrict it to an upper case "A" use:
=AND(LEN(A1)=8,LEFT(A1,1)="A",ISNUMBER(VALUE(RIGHT (A1,7)))

The previous formula allowed either upper or lower case.
--
sb
"Gareth" wrote in message
...
Tom and steve

it still allows me to enter a small 'a'

Gareth

"steve" wrote in message
...
Tom,

Thanks for pointing me to "ISNUMBER". I was getting ready to suggest
an event macro.

A further mod would be to use "VALUE" instead of "*1".
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(VALU E(RIGHT(A1,7)))

[watch word wrap]
--
sb
"Tom Ogilvy" wrote in message
...
Steve's suggestion worked for me. did you select A1 and then do
Data=Validation, select custom and paste in the formula?

Here is a modification to restrict the last 7 to numbers:

=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(RIGH T(A1,7)*1))

--
Regards,
Tom Ogilvy

"Gareth" wrote in message
...
Steve

Cannot seem to get it to work, I can see what LEN does and what

LEFT(A1,1)
does but it doesn't work.

Also, is it possible to ensure that the last 7 characters are

numerical?

Gareth
"steve" wrote in message
...
Gareth,

For Data Validation (either manual or by code).
Set "Allow:" to "Custom"

In the "Formula:" box put
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a")
(this is for cell A1, adjust as needed)
change to
=AND(LEN(A1)=8,A1="A")
to accept only capital A

In code it would look something like this
With Selection.Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop,

_
Operator:= _
xlBetween, Formula1:="=AND(LEN(E1)=8,E1:E1=""A"")"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

[you can remove or amend most of the lines after the formula part]

hth

--
sb
"Gareth" wrote in message
...
I need to ensure that users only enter a customer number in the
correct
format in a cell.

The format is an 'A' followed by 7 numbers.

How can I use validation to ensure only this type of entry is

allowed?

Gareth














  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Data I have Excel 2002 as part of Office XP Standard. I tried alidation, I think

Gareth,

This will ensure a capital A
=AND(LEN(A1)=8,CODE(A1)=65,ISNUMBER(VALUE(RIGHT(A1 ,7))))

[watch for word wrap]

Sorry for my error! I thought that LEFT(A1,1)="A" was case sensitive.
Now I know better...

--
sb
"Gareth" wrote in message
...
still allows a small 'a'!

"steve" wrote in message
...
Gareth,

To restrict it to an upper case "A" use:
=AND(LEN(A1)=8,LEFT(A1,1)="A",ISNUMBER(VALUE(RIGHT (A1,7)))

The previous formula allowed either upper or lower case.
--
sb
"Gareth" wrote in message
...
Tom and steve

it still allows me to enter a small 'a'

Gareth

"steve" wrote in message
...
Tom,

Thanks for pointing me to "ISNUMBER". I was getting ready to

suggest
an event macro.

A further mod would be to use "VALUE" instead of "*1".
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(VALU E(RIGHT(A1,7)))

[watch word wrap]
--
sb
"Tom Ogilvy" wrote in message
...
Steve's suggestion worked for me. did you select A1 and then do
Data=Validation, select custom and paste in the formula?

Here is a modification to restrict the last 7 to numbers:

=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(RIGH T(A1,7)*1))

--
Regards,
Tom Ogilvy

"Gareth" wrote in message
...
Steve

Cannot seem to get it to work, I can see what LEN does and what
LEFT(A1,1)
does but it doesn't work.

Also, is it possible to ensure that the last 7 characters are
numerical?

Gareth
"steve" wrote in message
...
Gareth,

For Data Validation (either manual or by code).
Set "Allow:" to "Custom"

In the "Formula:" box put
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a")
(this is for cell A1, adjust as needed)
change to
=AND(LEN(A1)=8,A1="A")
to accept only capital A

In code it would look something like this
With Selection.Validation
.Delete
.Add Type:=xlValidateCustom,

AlertStyle:=xlValidAlertStop,
_
Operator:= _
xlBetween, Formula1:="=AND(LEN(E1)=8,E1:E1=""A"")"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

[you can remove or amend most of the lines after the formula

part]

hth

--
sb
"Gareth" wrote in message
...
I need to ensure that users only enter a customer number in

the
correct
format in a cell.

The format is an 'A' followed by 7 numbers.

How can I use validation to ensure only this type of entry

is
allowed?

Gareth


















  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Data I have Excel 2002 as part of Office XP Standard. I tried alidation, I think

steve

many, many thanks for your help over the last couple of days.

Gareth
"steve" wrote in message
...
Gareth,

This will ensure a capital A
=AND(LEN(A1)=8,CODE(A1)=65,ISNUMBER(VALUE(RIGHT(A1 ,7))))

[watch for word wrap]

Sorry for my error! I thought that LEFT(A1,1)="A" was case sensitive.
Now I know better...

--
sb
"Gareth" wrote in message
...
still allows a small 'a'!

"steve" wrote in message
...
Gareth,

To restrict it to an upper case "A" use:
=AND(LEN(A1)=8,LEFT(A1,1)="A",ISNUMBER(VALUE(RIGHT (A1,7)))

The previous formula allowed either upper or lower case.
--
sb
"Gareth" wrote in message
...
Tom and steve

it still allows me to enter a small 'a'

Gareth

"steve" wrote in message
...
Tom,

Thanks for pointing me to "ISNUMBER". I was getting ready to

suggest
an event macro.

A further mod would be to use "VALUE" instead of "*1".
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(VALU E(RIGHT(A1,7)))

[watch word wrap]
--
sb
"Tom Ogilvy" wrote in message
...
Steve's suggestion worked for me. did you select A1 and then do
Data=Validation, select custom and paste in the formula?

Here is a modification to restrict the last 7 to numbers:

=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a",ISNUMBER(RIGH T(A1,7)*1))

--
Regards,
Tom Ogilvy

"Gareth" wrote in message
...
Steve

Cannot seem to get it to work, I can see what LEN does and

what
LEFT(A1,1)
does but it doesn't work.

Also, is it possible to ensure that the last 7 characters are
numerical?

Gareth
"steve" wrote in message
...
Gareth,

For Data Validation (either manual or by code).
Set "Allow:" to "Custom"

In the "Formula:" box put
=AND(LEN(A1)=8,LOWER(LEFT(A1,1))="a")
(this is for cell A1, adjust as needed)
change to
=AND(LEN(A1)=8,A1="A")
to accept only capital A

In code it would look something like this
With Selection.Validation
.Delete
.Add Type:=xlValidateCustom,

AlertStyle:=xlValidAlertStop,
_
Operator:= _
xlBetween, Formula1:="=AND(LEN(E1)=8,E1:E1=""A"")"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

[you can remove or amend most of the lines after the formula

part]

hth

--
sb
"Gareth" wrote in message
...
I need to ensure that users only enter a customer number

in
the
correct
format in a cell.

The format is an 'A' followed by 7 numbers.

How can I use validation to ensure only this type of entry

is
allowed?

Gareth




















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
Install Office Standard XP on Vista. Uninstall Office 2007 Trial? Machete Excel Discussion (Misc queries) 1 August 11th 09 03:54 AM
Excel Office Standard Editiion 2003 convert DebbieNTM Excel Discussion (Misc queries) 0 August 12th 08 03:55 PM
Why no XML in Excel 2003 with Office Standard? [email protected] Excel Discussion (Misc queries) 0 April 21st 06 10:36 PM
Standard Balance Sheet format in Microsoft Office Excel 2003(2) heberling Excel Worksheet Functions 4 July 27th 05 06:58 PM
can't find map button in Excel in Office Standard Edition 2003 Nitsirk Excel Worksheet Functions 3 March 22nd 05 02:20 AM


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