ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run Time Error 424 (https://www.excelbanter.com/excel-programming/292844-run-time-error-424-a.html)

ExcelMonkey[_88_]

Run Time Error 424
 
I have a macro which runs while a number of workbooks are open. I kee
getting a Run Time Error 424 when I do the following:

Workbooks(workbook1.xls).Worksheets("Data").Range( "PasteCell").Value
Workbooks(workbook2.xls).Worksheets("Supply").Rang e("CopyCell").Value

I know that both worksheets are open and that the sheet names ar
correct as well as the named ranges. What am I doing wrong?

Thank

--
Message posted from http://www.ExcelForum.com


Chip Pearson

Run Time Error 424
 
Put the workbook names in quotes. E.g.,

Workbooks("workbook1.xls").Worksheets("Data").Rang e("PasteCell").
Value =
Workbooks("workbook2.xls").Worksheets("Supply").Ra nge("CopyCell")
..Value


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"ExcelMonkey " wrote
in message ...
I have a macro which runs while a number of workbooks are open.

I keep
getting a Run Time Error 424 when I do the following:


Workbooks(workbook1.xls).Worksheets("Data").Range( "PasteCell").Va
lue =

Workbooks(workbook2.xls).Worksheets("Supply").Rang e("CopyCell").V
alue

I know that both worksheets are open and that the sheet names

are
correct as well as the named ranges. What am I doing wrong?

Thanks


---
Message posted from http://www.ExcelForum.com/




ExcelMonkey[_89_]

Run Time Error 424
 
Duh...Thanks Chi

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 03:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com