Defining a variable to = MATCH

M

mpjohnston

Dim thingy As Integer

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

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

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

Any suggestions on correcting this?
Mik
 
J

Juan Pablo González

Try with

thingy = Application.Match("DiceC",
Sheets("qperiodagentperformance").Range("A:A"), 0)

and define thingy as long instead...
 
J

Juan Pablo González

Altough that will cause an error, 'cause thingy is dimmed as an integer...
 
D

Dave Peterson

Another:

dim Thingy as Variant

Thingy = application.match("dicec",worksheets("qperiodagentperformance") _
.range("a:a"),0)

if iserror(thingy) then
msgbox "not found"
else
'msgbox "found in Row: " & thingy
'do the rest of you stuff here.
end if
 
Top