what this is error?

X

x tomi3440

[g2]="08-01-c-0001"
[g3]="08-01-c-0002"
[g4]="08-01-cx-0003"
fil3="xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT(((MID((" & adr &
"),7,FIND(""-"",(" & adr & "),7)-7))=""" & fil3 & """)+0)")

this is code.... error occurrence
why?????




*** Sent via Developersdex http://www.developersdex.com ***
 
J

Jim Cone

What version of XL are you using?
How are the variables declared?
What is the error?
What line?
What are you trying to do?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



<[email protected]>
wrote in message
[g2]="08-01-c-0001"
[g3]="08-01-c-0002"
[g4]="08-01-cx-0003"
fil3="xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT(((MID((" & adr &
"),7,FIND(""-"",(" & adr & "),7)-7))=""" & fil3 & """)+0)")

this is code.... error occurrence
why?????
*** Sent via Developersdex http://www.developersdex.com ***
 
B

Bob Phillips

Worked fine for me, returned 0, but worked.

Maybe
[g2]="08-01-c-0001"
[g3]="08-01-c-0002"
[g4]="08-01-cx-0003"
fil3="xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT(((MID((" & adr & _
"),7,FIND(""-"",(" & adr & "),7)-7))=""" & fil3 & """)+0)")


--
HTH

Bob

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

Bob Phillips

BTW, too many brackets

Public Sub Test()
Dim fil3, adr, nnn
[g2] = "08-01-c-0001"
[g3] = "08-01-c-0002"
[g4] = "08-01-cx-0003"
fil3 = "xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT((MID(" & adr & _
",7,FIND(""-"",(" & adr & "),7)-7)=""" & fil3 & """)+0)")
End Sub


--
HTH

Bob

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

Ivyleaf

Hi,

I didn't have a problem with the brackets, but there appear to be one
too many sets of quotes around the ' & fil3 & ' unless I am mistaken.
Likewise it returned 0 for me though.

Cheers,

BTW, too many brackets

Public Sub Test()
Dim fil3, adr, nnn
[g2] = "08-01-c-0001"
[g3] = "08-01-c-0002"
[g4] = "08-01-cx-0003"
fil3 = "xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT((MID(" & adr & _
       ",7,FIND(""-"",(" & adr & "),7)-7)=""" & fil3 & """)+0)")
End Sub

--
HTH

Bob

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




[g2]="08-01-c-0001"
[g3]="08-01-c-0002"
[g4]="08-01-cx-0003"
fil3="xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT(((MID((" & adr &
"),7,FIND(""-"",(" & adr & "),7)-7))=""" & fil3 & """)+0)")
this is code.... error occurrence
why?????
*** Sent via Developersdexhttp://www.developersdex.com***- Hide quoted text -

- Show quoted text -
 
B

Bob Phillips

They don't cause a problem, but they are redundant.

You're wrong about the quotes, they are required for text strings.

--
HTH

Bob

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

Hi,

I didn't have a problem with the brackets, but there appear to be one
too many sets of quotes around the ' & fil3 & ' unless I am mistaken.
Likewise it returned 0 for me though.

Cheers,

BTW, too many brackets

Public Sub Test()
Dim fil3, adr, nnn
[g2] = "08-01-c-0001"
[g3] = "08-01-c-0002"
[g4] = "08-01-cx-0003"
fil3 = "xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT((MID(" & adr & _
",7,FIND(""-"",(" & adr & "),7)-7)=""" & fil3 & """)+0)")
End Sub

--
HTH

Bob

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




[g2]="08-01-c-0001"
[g3]="08-01-c-0002"
[g4]="08-01-cx-0003"
fil3="xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT(((MID((" & adr &
"),7,FIND(""-"",(" & adr & "),7)-7))=""" & fil3 & """)+0)")
this is code.... error occurrence
why?????
*** Sent via Developersdexhttp://www.developersdex.com***- Hide quoted
text -

- Show quoted text -
 
I

Ivyleaf

Hi Bob,

I stand corrected. I just checked again and I had made the mistake of
thinking his 'fil3' variable was a range, not a string.

Cheers,
Ivan.

They don't cause a problem, but they are redundant.

You're wrong about the quotes, they are required for text strings.

--
HTH

Bob

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


Hi,

I didn't have a problem with the brackets, but there appear to be one
too many sets of quotes around the ' & fil3 & ' unless I am mistaken.
Likewise it returned 0 for me though.

Cheers,

BTW, too many brackets
Public Sub Test()
Dim fil3, adr, nnn
[g2] = "08-01-c-0001"
[g3] = "08-01-c-0002"
[g4] = "08-01-cx-0003"
fil3 = "xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT((MID(" & adr & _
",7,FIND(""-"",(" & adr & "),7)-7)=""" & fil3 & """)+0)")
End Sub

(there's no email, no snail mail, but somewhere should be gmail in my
addy)
[g2]="08-01-c-0001"
[g3]="08-01-c-0002"
[g4]="08-01-cx-0003"
fil3="xy"
adr = [g2:g4].Address
nnn = Application.Evaluate("=SUMPRODUCT(((MID((" & adr &
"),7,FIND(""-"",(" & adr & "),7)-7))=""" & fil3 & """)+0)")
this is code.... error occurrence
why?????
*** Sent via Developersdexhttp://www.developersdex.com***-Hide quoted
text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
X

x tomi3440

bob & ivan ,,, i'm sorry....
the problem was adr = [g2:g4].Address .....
that clause adr=shtname & "!" & [g2:g4].Address
the follwing the problem solved....
the sheet name.. i missed...

thank you very much...

*** Sent via Developersdex http://www.developersdex.com ***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top