这是给我错误的微小宏:
错误:Application Defined or Object Defined Error
根据MatMug的建议,这是完整的代码:
Sub insertTodayDate()
Dim cellD3 As Range
Dim helpComment As String
Set cellD3 = Range("D3")
cellD3.FormulaR1C1 = "=Today()"
cellD3.Copy
cellD3.PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
cellD3.Select
helpComment = "hello"
Call addCustomComment(helpComment)
Range("D4").Select
End Sub
Sub addCustomComment(text)
Dim wksProforma As Worksheet
Dim dateRange As Range
Set wksProforma = Worksheets("Proforma")
Set dateRange = wksProforma.Range("D3")
dateRange.AddComment "text"
End Sub
为什么最后一行dateRange.AddComment(text)
无效?
由于