I am trying to complete a VBA vlookup.

File A is where I am trying to enter the VBA vlookup formula. File B is where the table array is. The table array will be from column A to R, but the last row in column R where I need to get the vlookup from may change from month to month depending on how much data there is in a given month. I only want to vlookup the table array in File B to the very last value in column R. How would I do this? I have part of the macro below. Where it is bolded R???, this is where I think I need some kind of funtion to find the last value/cell in column R of file B. Not sure what I need to put here though.

Dim Work_File As String
Work_File = "FileA"
Workbooks(Work_File).Worksheets("FileA tab").Activate
top1 = "AB40"
Bottom_1 = Range(Selection, Selection.End(xlDown)).Rows.Count + 39
Let MyRange = top1 & ":" & "AB" & Bottom_1
Range("AB40").Select
ActiveCell.FormulaR1C1 = "=iferror((VLOOKUP(RC[-27],'[FileB]FileB tab'!a39:R???,18,FALSE)),0)"