I am looping through a file with a for each statement and then in the for loop statement i am comparing the value of the cell with tickers to the for each loop ticker value and if the same i assign the value of the shares for the ticker to the totshares variable with the parameter of the Ticker in question.
then later on down the code when i reference TotShare(ThisTicker) I will be able to see how many shares for each specific ticker.
How do I set this up so TotShares will take a parameter.
Thanks Lino
For Each NewTicker In Range("C1:C" & Range("C65536").End(xlUp).Row)
ThisTicker = NewTicker.Value
For i = 1 To FinalRow
If Cells(i, 3) = ThisTicker And (Action = "B" Or Action = "BL") Then
TotShares(ThisTicker) = TotShares + Cells(i, 2)
End If
Next i
then later on down the code when i reference TotShare(ThisTicker) I will be able to see how many shares for each specific ticker.
How do I set this up so TotShares will take a parameter.
Thanks Lino
For Each NewTicker In Range("C1:C" & Range("C65536").End(xlUp).Row)
ThisTicker = NewTicker.Value
For i = 1 To FinalRow
If Cells(i, 3) = ThisTicker And (Action = "B" Or Action = "BL") Then
TotShares(ThisTicker) = TotShares + Cells(i, 2)
End If
Next i