Defining a variable to = MATCH

  • Thread starter Thread starter mpjohnston
  • Start date Start date
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
 
Try with

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

and define thingy as long instead...
 
Altough that will cause an error, 'cause thingy is dimmed as an integer...
 
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
 

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

Back
Top