Confused about sheets and "Select" vs "Activate"
I tried to duplicate your situation by having two workbooks open and issuing
each of the statements you've listed. If the workbook that I tried to
"SELECT" the sheet in was not the active workbook, I got the error. As long
as I was selecting the sheet in the active workbook, however, there was no
problem. I could, however "ACTIVATE" any sheet regardless of which workbook
is active.
I think the the "SELECT" option only looks to the active workbook even when
you specify a workbook, whereas the "ACTIVATE" command seems to be able to
use anything within the Excel application. I get a similar response when
trying to "ACTIVATE" or "SELECT" a cell that's not in the active sheet.
Anyway, this is what I came up with, maybe some of the MVP folks here know
more about it, and may have to correct me if I'm mistaken.
HTH
Bill
"Robert Crandal" wrote:
Yes, that is correct. I have several workbooks open.
I thought that Workbooks("DataBook.xlsm") would specify
the correct workbook and therefore that either
Sheets(n).Activate OR Sheets(n).Select would do the same
thing????
"Gary Keramidas" <GKeramidasAtMSN.com wrote in message
...
i'm guessing you're trying to select a sheet in a non-active workbook. do
you have more than 1 workbook open?
--
Gary Keramidas
Excel 2003
.
|