我想在“A1”中插入一些文本“ABC”和“B1”中的以下单元格一个if
语句。但是,我只插入了第一个条目“ABC”,然后在FormulaR1C2 "Object doesn't support this property or method"
. 我不确定我是否使用R1C2
正确。我假设它代表第 1 行第 2 列,有人可以帮助我。
Dim Excel_App As Object
Dim strExcel As String
Set Excel_App = CreateObject("Excel.Application")
Excel_App.Visible = True
Excel_App.Workbooks.Add
With Excel_App
.Range("A:B").EntireRow.ColumnWidth = 25
.Range("A2").EntireRow.Font.FontStyle = "Bold"
.ActiveCell.FormulaR1C1 = "ABC"
strExcel = "=IF(A1 = """"," & """EMPTY""" & "," & """FILLED""" & ") "
.ActiveCell.FormulaR1C2 = strExcel
End With