Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Case sensative list validation

Is there a way to validate against a list and return invalid if it does not
match the case of the list. Here is the code i'm using now in my macro:

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$IF$5:$IF$20000"
.InCellDropdown = False
End With

One of the cells in the list contains "Hardwood Lumber - BF," however it
says that "hardwood lumber - bf" is valid. Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Case sensative list validation

You could try this

With Selection.Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="=EXACT(" & ActiveCell.Address(False, False) &
_
",INDEX($I$5:$I$20000,MATCH(" & ActiveCell.Address(False, False)
& _
",$I$5:$I$20000,0)))"
.InCellDropdown = False
End With


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dave L" wrote in message
...
Is there a way to validate against a list and return invalid if it does
not
match the case of the list. Here is the code i'm using now in my macro:

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="=$IF$5:$IF$20000"
.InCellDropdown = False
End With

One of the cells in the list contains "Hardwood Lumber - BF," however it
says that "hardwood lumber - bf" is valid. Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Case sensative list validation

Thanks Bob, but i got a compile syntax error when i tried to run it. I'm kind
of a novice with VBA so I don't know how to fix it.

"Bob Phillips" wrote:

You could try this

With Selection.Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="=EXACT(" & ActiveCell.Address(False, False) &
_
",INDEX($I$5:$I$20000,MATCH(" & ActiveCell.Address(False, False)
& _
",$I$5:$I$20000,0)))"
.InCellDropdown = False
End With


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dave L" wrote in message
...
Is there a way to validate against a list and return invalid if it does
not
match the case of the list. Here is the code i'm using now in my macro:

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="=$IF$5:$IF$20000"
.InCellDropdown = False
End With

One of the cells in the list contains "Hardwood Lumber - BF," however it
says that "hardwood lumber - bf" is valid. Any ideas?




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Case sensative list validation

maybe wrap-around. Try this version

With Selection.Validation
.Delete
.Add Type:=xlValidateCustom, _
AlertStyle:=xlValidAlertStop, _
Operator:= xlBetween, _
Formula1:="=EXACT(" & ActiveCell.Address(False, False) _
& ",INDEX($I$5:$I$20000,MATCH(" _
& ActiveCell.Address(False, False) _
& _",$I$5:$I$20000,0)))"
.InCellDropdown
End With

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dave L" wrote in message
...
Thanks Bob, but i got a compile syntax error when i tried to run it. I'm
kind
of a novice with VBA so I don't know how to fix it.

"Bob Phillips" wrote:

You could try this

With Selection.Validation
.Delete
.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="=EXACT(" & ActiveCell.Address(False, False)
&
_
",INDEX($I$5:$I$20000,MATCH(" & ActiveCell.Address(False,
False)
& _
",$I$5:$I$20000,0)))"
.InCellDropdown = False
End With


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Dave L" wrote in message
...
Is there a way to validate against a list and return invalid if it does
not
match the case of the list. Here is the code i'm using now in my macro:

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:=
_
xlBetween, Formula1:="=$IF$5:$IF$20000"
.InCellDropdown = False
End With

One of the cells in the list contains "Hardwood Lumber - BF," however
it
says that "hardwood lumber - bf" is valid. Any ideas?






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
do formulas have to be case sensative when searching words elaine Excel Discussion (Misc queries) 2 July 17th 07 10:18 AM
case sensetive data validation [email protected] Excel Worksheet Functions 5 January 27th 07 11:14 AM
Validation vs Case Ken Excel Discussion (Misc queries) 3 November 18th 06 08:12 PM
Validation ... Case Sensitive? Ken Excel Discussion (Misc queries) 2 November 16th 06 12:30 AM
Case Sensitivity problem with data validation Upya Excel Worksheet Functions 3 October 7th 05 01:30 AM


All times are GMT +1. The time now is 10:08 AM.

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"