Activation inheritance
Mats,
Yes, you cannot .Activate/.Select an object unless its .Parent is active. So
you need to step through like that.
Or
Application.Goto Workbooks(2).Worksheets(1).Range("A2")
However, for most of Excel's functionality, you do not need to .activate the
object(s) in order to use them. Depends what you are doing.
NickHK
"Mats Samson" wrote in message
...
I'm a little bit confused that the following does not seem to be valid.
Copy from another active Workbook and
Workbooks("A").Worksheets("B"). Range("Goal"). Activate
Paste....
If Worksheets("A") was the active sheet before switching to another WB
then
the code returns to the A-sheet and give me the error 1004 as it cannot
find
the
range "Goal" in this sheet.
Is it really necessary to acivate each part individually?
Workbooks("A").Activate
Worksheets("B").Activate
Range("Goal"). Activate
Why? It doesn't seem to be logic!
|