单元格地址无法正确返回VBA

时间:2017-09-26 09:40:28

标签: excel vba excel-vba

我正在尝试将变量与当前工作簿中的另一个工作簿单元格引用相乘。 Outstval地址打印为$N$28,并在没有绝对参考的情况下调用乘法,返回P32

Sub dummy()

Dim wb1 As Workbook
Dim A1, Outst, Outstval As Range

Dim PTC As Integer

Set wb1 = Workbooks.Open("C:\Users\ashokkumar.d\Desktop\New folder (2)\20170221_Par Mosec Marquez Waterfall (1T SLCE) - EIS.xlsb")

PTC = 1
With ActiveSheet
    Set A1 = .UsedRange.find("SERIES A1")

    Set Outst = A1.Offset(1, 0)
    Set Outstval = Outst.Offset(2, 0)
    Debug.Print Outstval.Address  /  printing address is $N$28
    ThisWorkbook.Activate
    With ThisWorkbook.Worksheets(1)
        .Range("C5").Formula = "= ( " & PTC & "*" & Outstval.Address(False, Flase, xlExternal) & " )"
    End With
End With

End Sub

在具有公式= ( 1*'[20170221_Par Mosec Marquez Waterfall (1T SLCE) - EIS.xlsb]Waterfall'!P32 ) ...

的C5单元格中

为什么P32代替N28

0 个答案:

没有答案