简体   繁体   中英

What does this line mean in Excel VBA?

I dont really get this line of code.

With Worksheets("SKU2PCA")
  .Range(Cells(SKU2PCA_New_RowNum + 1, SKU2PCA_StartBkt_ColNum), Cells(SKU2PCA_New_RowNum + PCACount, SKU2PCA_Last_ColNum)).FormulaR1C1 = _
            "=VLOOKUP(RC1&RC2,BOM!C4:C5,2,FALSE)*SKU2PCA_Staging!R" & SKU2PCA_Last_RowNum + 1 & ""
        Selection.NumberFormat = "General"

    End With

I am understanding that it means like

RC1&RC2 : This row 1st column and This row 2nd Column
Find for the Rc1& Rc2 in the BOM worksheet in the ranges of C4 to C5 and obtain the 2nd column value with exact matching.

But the *SKU2PCA_Staging onwards is what i dont get it

SKU2PCA_Staging is a another worksheet with table and SKU2PCA_Last_RowNum is an Int value.

Thanks!

"=VLOOKUP(RC1&RC2,BOM!C4:C5,2,FALSE)*SKU2PCA_Staging!R" & SKU2PCA_Last_RowNum + 1 & ""

The above is a multiplication of two values. The first is VLOOKUP(RC1&RC2,BOM!C4:C5,2,FALSE) , the second SKU2PCA_Staging!R" & SKU2PCA_Last_RowNum + 1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM