简体   繁体   中英

Run-time error 1004:

Hi I am very new to coding on excel and have been trying to fix a xlsm file that links a bunch of data sheets together that was created by a previous employee. when ever I click on the button to generate a report from the other workbooks I receive error 1004. I ran the debug and the error showing up is

Private Sub resetErrors()
    With ThisWorkbook.Worksheets("Generate Report")
        .Range("E2").Interior.ColorIndex = 0
        .Range("D5").Interior.ColorIndex = 0
        .Range("D7").Interior.ColorIndex = 0
        .Range("D9").Interior.ColorIndex = 0
        .Range("H2").Interior.ColorIndex = 0
        .Range("E3").Interior.ColorIndex = 0
    End With
End Sub

the range e2 is the one highlighted. I thought it had to do with missing data on one of the worksheets but cannot seem to find any. Any help in a very simple terms would be greatly appreciated. Thanks

检查工作表的名称,是否为“生成报告”?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM