Just started learning VBA
I want to multiply the product price with the currency value to get a new price.
No Name Quantity Price Product Currency OrderID Currency $
1 Tim 5 5 A HKD RX12 HKD 1
2 Alan 6 5 A HKD PR22 USD 7.8
3 Alan 2 6 B USD PR22 CAN 6
4 Bob 3 5 A HKD ED45
5 Bob 8 8 C CAN ED45
6 Tim 10 6 B USD AS63
7 Rose 12 8 C CAN LM36
8 Cathy 15 6 B USD JI48
9 Rose 2 5 A HKD HG54
10 Tim 8 6 B USD VB87
Here's the code I've tried so far. I keep getting object not defined errors. How can I fix this?
Sub NP()
Dim NP, i As Integer
NP = Range("L2:L11").Value
For i = 1 To 10
P = Cells(4, i)
curr = Cells(6, i)
If curr = "HKD" Then
NP = Range("J2").Value * P
ElseIf curr = "USD" Then
NP = Range("J3").Value * P
Else
NP = Range("J4").Value * P
End If
Next i
End Sub