Help with Type mismatch error

  • Thread starter Thread starter Ayo
  • Start date Start date
A

Ayo

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
 
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.
 
Back
Top