Discussion:
how to select cells from a non active worksheet
(too old to reply)
Mekinnik
18 years ago
Permalink
I am trying to select all the cells from column 'A' of the non-active worksheet
Faisal...
18 years ago
Permalink
I don't think that this is possible. What is your objective?

Faisal...
Post by Mekinnik
I am trying to select all the cells from column 'A' of the non-active worksheet
Jim Thomlinson
18 years ago
Permalink
You can only select on an active worksheet. That being said in the world of
macro land you do not need to select cells to reference them. In fact if you
can you're best off not to select cells as that is extra overhead that is not
necessary. Post what you want to accomplish and we can (hopefully) help you
get around the whole selection thing...
--
HTH...

Jim Thomlinson
Post by Mekinnik
I am trying to select all the cells from column 'A' of the non-active worksheet
Susan
18 years ago
Permalink
the short answer is, you can't.
however, you don't have to select a cell, a worksheet, a workbook, or
any other object in order to manipulate it.

to use select, first you'd have to activate worksheet B (for
instance), and then re-select worksheet A after you've done whatever
you want to do in worksheet B.

it's a different concept alltogether to identify the worksheets and
then work with them without actually selecting them.

for instance (just quickie code) the way you're doing it:
(starting in Worksheet A)
worksheetB.select
range("a1").select
selection.copy
worksheetA.select
range("a1").select
selection.paste

OR

(after declaring all the variables)
worksheetA.range("a1").value = worksheetB.range("a1").value

hope it helps
susan
Post by Mekinnik
I am trying to select all the cells from column 'A' of the non-active worksheet
Nigel
18 years ago
Permalink
If the non-active sheet is in the active workbook you can use.....

Sheets("Sheet1").Columns("A:A").Select

If it is in another workbook then use....

Workbooks("NonActive.xls").Sheets("Sheet1").Columns("A:A").Select
--
Regards,
Nigel
Post by Mekinnik
I am trying to select all the cells from column 'A' of the non-active worksheet
Nigel
18 years ago
Permalink
Forget my last reply, you cannot 'select' but can reference them. Or
activate the sheet then select them.
--
Regards,
Nigel
Post by Mekinnik
I am trying to select all the cells from column 'A' of the non-active worksheet
Continue reading on narkive:
Loading...