I have this code that gives me 2 different errors. In workbook 1, the workbook with the macro, I allow the user to open workbook 2 and copy a worksheet to workbook 1.
My first problem is if workbook 2 has no data. Then I get an error from the first 2 lines basically saying null was found and I can't assign null to a variable. Is there code that gets around that issue? If I can see the workbook has no data I can just add in code that doesn't copy anything.
The second problem is in line 5. The error is "Excel cannot complete this task with available resources. Choose less data or close other applications."
This occurs if the only cells in workbook 2 with data are A1, A2, B1, or B2. If I add data to column C or line 3 this problem goes away. Any idea what's going on here?
Thanks in advance for any help.
Bookmarks