LionRunner
New Member
- Joined
- Nov 13, 2014
- Messages
- 19
Hello,
My data is set up as can be seen at the bottom.
In VBA I am trying to evaluate column "Prodcut" for the value Product2, and in the if Product2 is in column Product I would like to sum the numeric values listed in column "Nov14" for the rows that correspond to the Prodcut2 values and and place that sum in cell T3.
The first thing is I'm getting a type mismatch prompt in my "For i" statment, highlighting the i. Then I don't think sum is correct but I don't know how to tell it to sum in VBA.
Can someone help. Thank you.
See my code so far:
Sub IGraph()
Dim Product As String, Nov13 As String, Nov14 As String, Nov13Sum As String, Nov14Sum As String, i As String
For i = 5 To 1000
Product = Cells(i, 2).Value
Nov14 = Cells(i, 8).Value
Nov14Sum = Cells(T3).Value
If Product = "Product2" Then
Nov14Sum = Sum(Nov14)
End If
End Sub
<TBODY>
</TBODY>
My data is set up as can be seen at the bottom.
In VBA I am trying to evaluate column "Prodcut" for the value Product2, and in the if Product2 is in column Product I would like to sum the numeric values listed in column "Nov14" for the rows that correspond to the Prodcut2 values and and place that sum in cell T3.
The first thing is I'm getting a type mismatch prompt in my "For i" statment, highlighting the i. Then I don't think sum is correct but I don't know how to tell it to sum in VBA.
Can someone help. Thank you.
See my code so far:
Sub IGraph()
Dim Product As String, Nov13 As String, Nov14 As String, Nov13Sum As String, Nov14Sum As String, i As String
For i = 5 To 1000
Product = Cells(i, 2).Value
Nov14 = Cells(i, 8).Value
Nov14Sum = Cells(T3).Value
If Product = "Product2" Then
Nov14Sum = Sum(Nov14)
End If
End Sub
<TBODY> </TBODY> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<TBODY>
</TBODY>