我在这里尝试了一些不同的演绎,我认为应该有所作为:
Sheets(Sheet1.Name).Range("Q2").Value = "=IF($H2="""","""",IF($L2=""Successful"",0,IF($O2="""",""Error"",!$O2)))"
Sheets(Sheet1.Name).Range("Q2").Formula = "=IF($H2="""","""",IF($L2=""Successful"",0,IF($O2="""",""Error"",!$O2)))"
Sheets(Sheet1.Name).[Q2].Formula = "=IF($H2="""","""",IF($L2=""Successful"",0,IF($O2="""",""Error"",!$O2)))"
Dim Data As Worksheet
Set Data = ThisWorkbook.Sheets(Sheets1.Name)
Data. (all of the above after the sheets part)
无论我做什么,都会产生1004错误。我做错了什么?
答案 0 :(得分:1)
似乎是“!”在“$ O2”之前。