ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to select cells from a non active worksheet (https://www.excelbanter.com/excel-programming/400493-how-select-cells-non-active-worksheet.html)

Mekinnik

how to select cells from a non active worksheet
 
I am trying to select all the cells from column 'A' of the non-active worksheet


Jim Thomlinson

how to select cells from a non active worksheet
 
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


"Mekinnik" wrote:

I am trying to select all the cells from column 'A' of the non-active worksheet


Faisal...

how to select cells from a non active worksheet
 
I don't think that this is possible. What is your objective?

Faisal...

On 2 Nov, 17:56, Mekinnik wrote:
I am trying to select all the cells from column 'A' of the non-active worksheet




Nigel[_2_]

how to select cells from a non active worksheet
 
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").Column s("A:A").Select
--

Regards,
Nigel




"Mekinnik" wrote in message
...
I am trying to select all the cells from column 'A' of the non-active
worksheet



Susan

how to select cells from a non active worksheet
 
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



On Nov 2, 1:56 pm, Mekinnik
wrote:
I am trying to select all the cells from column 'A' of the non-active worksheet




Nigel[_2_]

how to select cells from a non active worksheet
 
Forget my last reply, you cannot 'select' but can reference them. Or
activate the sheet then select them.

--

Regards,
Nigel




"Mekinnik" wrote in message
...
I am trying to select all the cells from column 'A' of the non-active
worksheet




All times are GMT +1. The time now is 10:15 PM.

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