Version: Excel 2016
Hi there,
I can't figure how to include a variable row number in an IF formula.
I use this to get the last row in OtherFile|Sheet1 and create variable LastRow.
LastRow = Cells.Find("*", Cells(1, 1), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
I then want create an IF formula in the current cell. The IF formula says "if B2 is > the last B cell in OtherFile.xlsx|Sheet1, then return 'New', otherwise; 'Old'".
ActiveCell.FormulaR1C1 = _
"=IF(RC[2]>'[OtherFile.xlsx]Sheet1'!R2C2,""New"",""Old"")"
So essentially I want a formula that would replace
with
Any pointers would be much appreciated!
Thanks.
Bookmarks