Hello.
I am trying to do the following in VB.
Reference a cell to a IF & Vlookup statement.
Here is what I have currently.
Z is a variable that works...data can range from line 6 to line 1000.
----------------------------
Private Sub Reset_Pricing_Click()
(works) For Z = 6 To 1000
(works) If Worksheets("Test").Cells(Z, 4).Value = "" Then GoTo Done
(doesn't work) Worksheets("Test").Cells(Z, 13).Formula = "=IF(C6)=""CTLG"",VLOOKUP(B6),Sheet2!A:AG,33,FALSE),IF(C6)=""PGC"",VLOOKUP(D6),Sheet2!A:AG,33,FALSE),""""))"
(works) Worksheets("Test").Range("A" & Z, "K" & Z).Interior.ColorIndex = xlNone
(works) Next Z
Done:
End Sub
-------------------------------
Any ideas / suggestions would be greatly appreciated. Thank you.
I am trying to do the following in VB.
Reference a cell to a IF & Vlookup statement.
Here is what I have currently.
Z is a variable that works...data can range from line 6 to line 1000.
----------------------------
Private Sub Reset_Pricing_Click()
(works) For Z = 6 To 1000
(works) If Worksheets("Test").Cells(Z, 4).Value = "" Then GoTo Done
(doesn't work) Worksheets("Test").Cells(Z, 13).Formula = "=IF(C6)=""CTLG"",VLOOKUP(B6),Sheet2!A:AG,33,FALSE),IF(C6)=""PGC"",VLOOKUP(D6),Sheet2!A:AG,33,FALSE),""""))"
(works) Worksheets("Test").Range("A" & Z, "K" & Z).Interior.ColorIndex = xlNone
(works) Next Z
Done:
End Sub
-------------------------------
Any ideas / suggestions would be greatly appreciated. Thank you.