Hi,

I am having a problem with a code in excel; I have searched the solution for 2 days on the internet and it seems there is no solution to something so simple. I want the code to write the function "= .15 * prices!Bi" where the index i is any integer from 1 to 1175 corresponding with the if statement. B is the column and i is the variable number


Here is the code I have in excel:

Sub test()
Dim i As Integer
Dim j As Integer

For i = 1 To 1175
For j = 1 To 439

If (Worksheets("prices").Cells(i, 1).Value = Worksheets("beachwood").Cells(j, 1).Value) Then
Worksheets("beachwood").Cells(j, 2).Formula = "= .15 * prices!Bi"
End If
Next j
Next i

End Sub