Forum Discussion

MicrosoftNewbie121's avatar
MicrosoftNewbie121
Brass Contributor
Jan 24, 2024
Solved

VBA Excel : Error 1004 - Delete Method out of Range class failed

Hello can you help me ? 

i get error1004 after executing this macro, it has something to do with delete method could you please help me fixing that ?

(Base bellow for testing)

 

 

 

  • MicrosoftNewbie121 

    The code tries to delete the header row of the table on Updated.

    To avoid that, change the line

        Set idCol2 = WSheet2.Range("B2:B" & lastRow2)

    to

        Set idCol2 = WSheet2.Range("B3:B" & lastRow2)

     

  • MicrosoftNewbie121 

    The code tries to delete the header row of the table on Updated.

    To avoid that, change the line

        Set idCol2 = WSheet2.Range("B2:B" & lastRow2)

    to

        Set idCol2 = WSheet2.Range("B3:B" & lastRow2)

     

Resources