S
salgud
I've posted about this error before, but no one can seem to figure it out.
I'm validating the input in a spreadsheet that is created by VBA. The
validation criteria works just fine when I enter it into the custom
validation box:
=AND(LEN(B7)=7,ISNUMBER(MID(B7,2,6)*1),CODE(LEFT(UPPER(B7),1))>64,CODE(LEFT(UPPER(B7),1))<91)
When I put that same forumla into VBA, as validation criteria, it looks
like:
..Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=AND(LEN(B7)=7,ISNUMBER(MID(B7,2,6)*1)
,CODE(LEFT(UPPER(B7),1))>64,CODE(LEFT(UPPER(B7),1))<91)"
This line gives a Application defined or object defined error. I've run the
first term (LEN(B7)=7 separately, and it runs fine. But the second term,
ISNUMBER(MID(B7,2,6)*1)
,CODE(LEFT(UPPER(B7),1))>64,CODE(LEFT(UPPER(B7),1))<91)
doesn't run. So does anyone see what is causing the problem?
Thanks in advance!
I'm validating the input in a spreadsheet that is created by VBA. The
validation criteria works just fine when I enter it into the custom
validation box:
=AND(LEN(B7)=7,ISNUMBER(MID(B7,2,6)*1),CODE(LEFT(UPPER(B7),1))>64,CODE(LEFT(UPPER(B7),1))<91)
When I put that same forumla into VBA, as validation criteria, it looks
like:
..Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=AND(LEN(B7)=7,ISNUMBER(MID(B7,2,6)*1)
,CODE(LEFT(UPPER(B7),1))>64,CODE(LEFT(UPPER(B7),1))<91)"
This line gives a Application defined or object defined error. I've run the
first term (LEN(B7)=7 separately, and it runs fine. But the second term,
ISNUMBER(MID(B7,2,6)*1)
,CODE(LEFT(UPPER(B7),1))>64,CODE(LEFT(UPPER(B7),1))<91)
doesn't run. So does anyone see what is causing the problem?
Thanks in advance!