Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM
Type Mismatch error Mike Excel Programming 3 January 17th 04 04:23 PM
help with type mismatch error Jin Excel Programming 1 January 8th 04 04:26 PM
Type mismatch error Stuart[_5_] Excel Programming 0 August 16th 03 05:20 PM


All times are GMT +1. The time now is 08:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"