Hi all,

I'm still getting slightly confused how to correctly qualify references of ranges if they live in the workbook the codes resides in. I was initially assuming they automatically refer to ThisWorkbook, but it seems they actually refer to the ActiveWorkbook instead, if not qualified explicitly. Below code gets the wrong column as the named range "Attribute_FlowDelivery" exists in BOTH workbooks, hence it takes the ActiveWorkbook rather than ThisWorkbook.

What are the best practises to qualify all cells and ranges in below example? Do I have to set the worksheet and do sht.Range("Attribute_FlowDelivery").Column in my .FormulaR1C1 or is there a better way?

Option Explicit
Sub GET_BUY()
    
    Dim RP As Workbook
    Set RP = Workbooks.Open(FileName:=RP_Name, UpdateLinks:=False, ReadOnly:=True)

    With ThisWorkbook.Sheets(SH_Recap.Index)
    
        With .Cells(StrtRw, .Range("Attribute_DeliveryMonth").Column)
            .FormulaR1C1 = "=IF(RC" & Range("Attribute_FlowDelivery").Column & "="""","""",UPPER(TEXT(RC" & Range("Attribute_FlowDelivery").Column & ",""mmm"")))"
            .Value = .Value
        End With

    End With
    
    RP.Close SaveChanges:=False

End Sub