保持提示应用程序定义的错误,我不认为有任何错误
ActiveSheet.Cells(salesNo + 1, 5).Formula = "=CONCATENATE(""Subtotal for ""& Cells(salesNo - 1, 3).Address)"
答案 0 :(得分:1)
ActiveSheet.Cells(salesNo + 1, 5).Formula = _
"=""Subtotal for "" & " & Cells(salesNo - 1, 3).Address
答案 1 :(得分:0)
ActiveSheet.Cells(salesNo + 1, 5).Formula _
= "=""Subtotal for ""&ADDRESS(" & salesNo - 1 & ",3)"
或
ActiveSheet.Cells(salesNo + 1, 5).Formula = "=" & Chr(34) _
& "Subtotal for " & Chr(34) & "&ADDRESS(" & salesNo - 1 & ",3)"
摆脱$符号:
ActiveSheet.Cells(salesNo + 1, 5).Formula _
= "=""Subtotal for ""&ADDRESS(" & salesNo - 1 & ",3,4)"
或
ActiveSheet.Cells(salesNo + 1, 5).Formula = "=" & Chr(34) _
& "Subtotal for " & Chr(34) & "&ADDRESS(" & salesNo - 1 & ",3,4)"
ActiveSheet.Cells(salesNo + 1, 5).Formula _
= "=""Subtotal for ""&INDIRECT(ADDRESS(" & salesNo - 1 & ",3,4))"
或
ActiveSheet.Cells(salesNo + 1, 5).Formula = "=" & Chr(34) _
& "Subtotal for " & Chr(34) & "&INDIRECT(ADDRESS(" & salesNo - 1 & ",3,4))"