Type mismatch error

M

mpjohnston

Dim thingy As Integer

thingy = "=MATCH(""DiceC"",qperiodagentperformance!A:A,0)"

ActiveCell.Formula = _
"=INDEX(qperiodagentperformance!D" & thingy
":D13000,MATCH(""Agent Summary"",qperiodagentperformance!A" & thingy
":A13000,0))"
Range("D26").Select

my thingy doesnt seem to work..... no comment
Mik
 
M

Myrna Larson

Your DIM statement says that thingy is an integer variable. Then you try to
assign a string (text) to it. That won't work. Try

Dim thingy As String
 
T

Tom Ogilvy

Your code is all screwed up.

You assign a string to thingy, dim it as integer and expect a long

Dim thingy as Variant

thingy = Evaluate("MATCH(""DiceC"",qperiodagentperformance!A:A,0)")

if not iserror(thingy) then
ActiveCell.Formula = _
"=INDEX(qperiodagentperformance!D" & thingy & _
":D13000,MATCH(""Agent Summary"",qperiodagentperformance!A" & thingy & _
":A13000,0))"

End if
 
D

Dave Peterson

And see a few more replies at your other post.

mpjohnston < said:
Dim thingy As Integer

thingy = "=MATCH(""DiceC"",qperiodagentperformance!A:A,0)"

ActiveCell.Formula = _
"=INDEX(qperiodagentperformance!D" & thingy &
":D13000,MATCH(""Agent Summary"",qperiodagentperformance!A" & thingy &
":A13000,0))"
Range("D26").Select

my thingy doesnt seem to work..... no comment
Mike
 
Top