Set BaseWks = Sheets("Summary Data")
Set PivotWks = Sheets("PivotTab")
lastrow = PivotWks.UsedRange.Rows.Count - PivotWks.UsedRange.Row
For n = 2 To lastrow
BaseWks.Cells(n, 5).Formula = (BaseWks.Cells(n, 6).Value) / (WorksheetFunction.VLookup(BaseWks.Cells(n, 3), PivotWks.Range("A2:B" & lastrow), 2, False))
Hi, I developed the above formula (so far) in an attempt to covert the excel formula to vba
As you can see, I've figured out the vlookup part (it works) and the division part. But putting the formula with 'IF' statement and as a live formula is been a problem so far.
When I say 'live' I want the formula to be there in the excel cell instead of just the value-result being displayed (which is whats happening now)
Any help is much appreciated!