You can use your favorite social network to register or link an existing account:
Or use your email address to register without a social network:
Sign in with these social networks:
Or enter your username and password
Forgot your password?
Yes, please link my existing account with for quick, secure access.
No, I would like to create a new account with my profile information.
Today’s author is Ron de Bruin, an Excel MVP. You can find more useful tips from Ron and links to Excel add-ins at his website: http://www.rondebruin.nl/
It is not possible to copy more than one sheet to a new workbook or existing workbook if there is a List (Excel 2003) or a Table (Excel 2007) in one of the worksheets.
The only manual way to work around this is to do it in two or more steps. First copy the sheets without a List or Table, and then copy each sheet that contains a List or Table one-at-a-time.
When you use VBA code like the following to copy more than one sheet to a new workbook you will get a 1004 error if you have more than one sheet selected and one of the sheets contains a List (Excel 2003) or Table (Excel 2007 and up).
Sheets(Array("Sheet1", "Sheet2")).Copy
In the macro below, I show you a workaround that enables you to copy the sheets and to avoid the error.
The solution is to add a new Window with the Workbook.NewWindow method, If you add a new window, the sheets are not grouped anymore in this window. If the sheets are not grouped, Excel will copy the sheets correctly into a new workbook.
Sub Copy_Worksheets() Dim TheActiveWindow As Window Dim TempWindow As Window With ActiveWorkbook Set TheActiveWindow = ActiveWindow Set TempWindow = .NewWindow .Sheets(Array("Sheet1", "sheet2")).Copy 'If you want to copy the selected sheets use 'TheActiveWindow.SelectedSheets.Copy End With TempWindow.Close End Sub
I use this technique, for example, in the mail macros on these two pages:
Outlook/Outlook Express/Windows Mail
http://www.rondebruin.nl/mail/folder1/mail3.htm
Outlook
http://www.rondebruin.nl/mail/folder2/mail3.htm
Important: If you protect your workbook (using Tools > Protection > Protect Workbook with Windows checked in Excel 2003, or Review > Protect Workbook >Protect Structure and Windows with Windows checked in Excel 2007), the macro code can't add a temporary window to the workbook, so you must add code to unprotect/protect the workbook to the macro.
Comments: (loading) Collapse