I am back again. I need more help. (By the way, I love this site). I need help with something I'm sure if very simple to many of you. I need to create a macro to copy a selection of data from an existing excel spreadsheet and copy it over to a new excel workbook keeping all of the same formatting (including column widths, etc.). I have most of it when I "recorded" a macro that simply made a copy of the spreadsheet and then moved it into a new workbook, which on the most part works, but the new worksheet has vlookups and command buttons on it that I do not need. I just the selected area that contains the data. I then recorded the macro to copy and special paste to remove the vlookup links, which I believe works, then I selected the data that I do not want and deleted it and I had to go into the Developer tab and activate "Design Mode" so I could delete the two (2) command buttons, then deactive Design Mode. That is pretty much how I recorded my macro. When I run it, it mostly works--it copies the entire page over to a new workbook, I believe it does the special paste for the selected data area that I want to keep, but then I get an "ERROR 1004" where it will not delete the selected area that I do not want nor the command buttons. I am sure it is something very simple that I am missing. It actually seems that this ERROR 1004 is coming up in the new workbook that is created, possibly because of the two command buttons that are being moved to the new workbook.
Here is the code that I have so far.
Please Login or Register to view this content.
Bookmarks