N/APosted on - 08/05/2011
I am doing work in Microsoft Excel and run a macro that copies worksheets and then places the worksheets into the same workbook from which they originated. When i do this, I receive an error message that resembles one of the following error messages:
Microsoft Visual Basic
Run-time error '1004':
Select method of Ranges class failed
Continue End Debug Help
I'm really confused about this error. Now please remove my confusion by giving me perfect solutions. Thanks.
Run time Error Problem in Microsoft Excel Sheet.
The Error 1004 message is an object catch all error defined message. Basically means the error doesn’t fit another error message type. As what I have in mind I think you changed some worksheets or may have deleted one of the worksheets, as what I’ve seen it seems like it’s the only thing, it might be.
Try including in what line in the error handler is highlighted it will give you a little clue in what line might be causing this problem.
I would advise referencing the code names of the worksheet rather than the sheet names. Code names cannot be changed by a user except they exit the Visual Basic Editor screen.
Another thing is you have ways to many activate and select statements. The could will be greatly simplified, take note that the space followed in an underscore in the end of the line denote a line prolongation in VB.