![]() |
run time error 1004
When running code that copies one named range from a workbook to a named
range in another workbook I get this run time error saying Select Method of Range Class failed. If i copy the range manually i get the message: "A formula or sheet you want to move or copy contains the name 'WPCodeDescription', which already exists on the destinatin sheet. Do you want to use this version of the name?" Here is the code that causes the error: Workbooks(WkbPrevious).Worksheets(CStr(Cell)).Rang e("WPCodeDescription").Copy Workbooks(wkb).Worksheets(CStr(Cell)).Range("WPCod eDescription").PasteSpecial xlPasteValues thanks for any help, Jake |
run time error 1004
You don't need to copy and paste. Just make the values equal. Try this
instead... Workbooks(wkb).Worksheets(CStr(Cell)).Range("WPCod eDescription").Value = _ Workbooks(WkbPrevious).Worksheets(CStr(Cell)).Rang e("WPCodeDescription").Value -- HTH... Jim Thomlinson "Jake" wrote: When running code that copies one named range from a workbook to a named range in another workbook I get this run time error saying Select Method of Range Class failed. If i copy the range manually i get the message: "A formula or sheet you want to move or copy contains the name 'WPCodeDescription', which already exists on the destinatin sheet. Do you want to use this version of the name?" Here is the code that causes the error: Workbooks(WkbPrevious).Worksheets(CStr(Cell)).Rang e("WPCodeDescription").Copy Workbooks(wkb).Worksheets(CStr(Cell)).Range("WPCod eDescription").PasteSpecial xlPasteValues thanks for any help, Jake |
run time error 1004
That's a help, thanks a million Jim!
"Jim Thomlinson" wrote: You don't need to copy and paste. Just make the values equal. Try this instead... Workbooks(wkb).Worksheets(CStr(Cell)).Range("WPCod eDescription").Value = _ Workbooks(WkbPrevious).Worksheets(CStr(Cell)).Rang e("WPCodeDescription").Value -- HTH... Jim Thomlinson "Jake" wrote: When running code that copies one named range from a workbook to a named range in another workbook I get this run time error saying Select Method of Range Class failed. If i copy the range manually i get the message: "A formula or sheet you want to move or copy contains the name 'WPCodeDescription', which already exists on the destinatin sheet. Do you want to use this version of the name?" Here is the code that causes the error: Workbooks(WkbPrevious).Worksheets(CStr(Cell)).Rang e("WPCodeDescription").Copy Workbooks(wkb).Worksheets(CStr(Cell)).Range("WPCod eDescription").PasteSpecial xlPasteValues thanks for any help, Jake |
All times are GMT +1. The time now is 10:02 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com