0
votes

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

1
bet you dont have a worksheet named "Generate Report", do you? - A.S.H
ThisWorkbook.Worksheets("Generate Report").Range("E2,D5,D7,H2,E3").Interior.ColorIndex = 0 (once you figure out the worksheet name issue) - Tim Williams

1 Answers

0
votes

Check the name of your worksheet, is it "Generate Report"?