Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Type mismatch error
I am geetting a type mismatch error on this code line and I can't figure out
how to resolve it. c.Offset(0, 1) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c)) For Each c In NLPws.Range("C" & i & ":C" & i + 3).Cells c.Offset(0, 1) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c)) 'c.Offset(0, 2) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS1 = "A")) c.Offset(0, 3) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS2 = "A")) c.Offset(0, 4) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS3 = "A")) c.Offset(0, 5) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS4 = "A")) 'c.Offset(0, 6) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS5 = "A")) c.Offset(0, 7) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS6 = "A")) 'c.Offset(0, 8) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS7 = "A")) 'c.Offset(0, 9) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS8 = "A")) c.Offset(0, 10) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS9 = "A")) c.Offset(0, 11) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS10 = "A")) c.Offset(0, 12) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS11 = "A")) c.Offset(0, 13) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS12 = "A")) c.Offset(0, 14) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS13 = "A")) Next c |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Type mismatch error
The likely cause is that you are trying to equate a range to a value or vice
versa. Check your Dim statements against the vairables used in your problem statement to make sure they are all the right data types. "Ayo" wrote in message ... I am geetting a type mismatch error on this code line and I can't figure out how to resolve it. c.Offset(0, 1) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c)) For Each c In NLPws.Range("C" & i & ":C" & i + 3).Cells c.Offset(0, 1) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c)) 'c.Offset(0, 2) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS1 = "A")) c.Offset(0, 3) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS2 = "A")) c.Offset(0, 4) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS3 = "A")) c.Offset(0, 5) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS4 = "A")) 'c.Offset(0, 6) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS5 = "A")) c.Offset(0, 7) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS6 = "A")) 'c.Offset(0, 8) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS7 = "A")) 'c.Offset(0, 9) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS8 = "A")) c.Offset(0, 10) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS9 = "A")) c.Offset(0, 11) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS10 = "A")) c.Offset(0, 12) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS11 = "A")) c.Offset(0, 13) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS12 = "A")) c.Offset(0, 14) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS13 = "A")) Next c |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Type mismatch error
I am having this exact problem, what did you do to resolve this?
"JLGWhiz" wrote: The likely cause is that you are trying to equate a range to a value or vice versa. Check your Dim statements against the vairables used in your problem statement to make sure they are all the right data types. "Ayo" wrote in message ... I am geetting a type mismatch error on this code line and I can't figure out how to resolve it. c.Offset(0, 1) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c)) For Each c In NLPws.Range("C" & i & ":C" & i + 3).Cells c.Offset(0, 1) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c)) 'c.Offset(0, 2) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS1 = "A")) c.Offset(0, 3) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS2 = "A")) c.Offset(0, 4) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS3 = "A")) c.Offset(0, 5) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS4 = "A")) 'c.Offset(0, 6) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS5 = "A")) c.Offset(0, 7) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS6 = "A")) 'c.Offset(0, 8) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS7 = "A")) 'c.Offset(0, 9) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS8 = "A")) c.Offset(0, 10) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS9 = "A")) c.Offset(0, 11) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS10 = "A")) c.Offset(0, 12) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS11 = "A")) c.Offset(0, 13) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS12 = "A")) c.Offset(0, 14) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS13 = "A")) Next c |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Type mismatch error
Check your other post.
DogLover wrote: I am having this exact problem, what did you do to resolve this? "JLGWhiz" wrote: The likely cause is that you are trying to equate a range to a value or vice versa. Check your Dim statements against the vairables used in your problem statement to make sure they are all the right data types. "Ayo" wrote in message ... I am geetting a type mismatch error on this code line and I can't figure out how to resolve it. c.Offset(0, 1) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c)) For Each c In NLPws.Range("C" & i & ":C" & i + 3).Cells c.Offset(0, 1) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c)) 'c.Offset(0, 2) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS1 = "A")) c.Offset(0, 3) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS2 = "A")) c.Offset(0, 4) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS3 = "A")) c.Offset(0, 5) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS4 = "A")) 'c.Offset(0, 6) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS5 = "A")) c.Offset(0, 7) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS6 = "A")) 'c.Offset(0, 8) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS7 = "A")) 'c.Offset(0, 9) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS8 = "A")) c.Offset(0, 10) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS9 = "A")) c.Offset(0, 11) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS10 = "A")) c.Offset(0, 12) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS11 = "A")) c.Offset(0, 13) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS12 = "A")) c.Offset(0, 14) = Application.WorksheetFunction.SumProduct(--(rngMarket = B & i), --(rngNLP = c), --(rngMS13 = "A")) Next c -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
runtime error 13 - type mismatch error in Excel 97 on Citrix | Excel Programming | |||
Conditional Formatting - Run Time Error '13' Type Mismatch Error | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming |