Home |
Search |
Today's Posts |
#4
![]() |
|||
|
|||
![]()
Bob,
I was hoping you guys could tell me "why?" Here's the code that's failing: MyPctOverall = Sheets("Data Sheet").Range("PctOverall").Value also attempted in Alan's suggested syntax as: MyPctOverall = Sheet5.Range("PctOverall").Value and as MyPctOverall = Sheet5.Range([PctOverall]).Value (This is a simplified form of what I'm attempting, but this exact syntax fails, and I don't know why.) All times I get the incredibly helpful "Run-time error 1004": Method 'Range' of object '_Worksheet' failed. But PctOverall IS a named range in Data Sheet / Sheet5, so I don't know what the problem is. I can reference PctOverall on the sheet itself with no errors. I'm not new to this stuff, and I'm sure I've done it before in exactly the way you suggest, Bob, but I don't get this. Why is it not working here? Chris |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro / Compile Error / Duplicate Declaration | Excel Worksheet Functions | |||
Macro to copy range from Excel files in folder | Excel Discussion (Misc queries) | |||
Is it possible to set a variable range in a macro? | About this forum | |||
Macro - define cell range for a sum function | Excel Discussion (Misc queries) | |||
Help with macro formula and variable | Excel Worksheet Functions |