我使用以下VBA公式遇到问题。代码工作直到我改变了
IFERROR(IF(VLOOKUP(RC1,ListPrice,11,FALSE)=0,VLOOKUP(RC1,ListPrice,12,FALSE),VLOOKUP(RC1,ListPrice,11,FALSE)),0)*RC6
到
iferror(IF(RC11="",RC12,RC11),0)*(RC6/IF(RC8="",1,RC8)
感谢您的帮助!
完成VBA:
Sub STDCOST()
Dim LastRow As Long
Sheets("EXPIRE").Select
Range("n1").Value = "Ext_Cost"
Range("n2").FormulaR1C1 = "=IFERROR(IF(RC11="",RC12,RC11),0)*(RC6/IF(RC8="",1,RC8)"
Range("I1").Select
With ActiveSheet
LastRow = .Cells(.Rows.Count, "I").End(xlUp).Row
End With
Range("n2").AutoFill Destination:=Range("n2:n" & LastRow)
Columns("n:n").Select
Range("n:n").Style = "Currency"
End Sub