ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Type mismatch error (https://www.excelbanter.com/excel-programming/308430-type-mismatch-error.html)

mpjohnston[_2_]

Type mismatch error
 
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

--
Message posted from http://www.ExcelForum.com


Myrna Larson

Type mismatch error
 
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


On Mon, 30 Aug 2004 15:12:43 -0500, mpjohnston
wrote:

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


---
Message posted from http://www.ExcelForum.com/



Tom Ogilvy

Type mismatch error
 
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

--
Regards,
Tom Ogilvy



"mpjohnston " wrote in message
...
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


---
Message posted from http://www.ExcelForum.com/




Dave Peterson[_3_]

Type mismatch error
 
And see a few more replies at your other post.

"mpjohnston <" wrote:

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

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson



All times are GMT +1. The time now is 08:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com