ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Why does Sheet.Range("A1").Select not work!!! (https://www.excelbanter.com/excel-programming/413718-why-does-sheet-range-a1-select-not-work.html)

DemonTraitor

Why does Sheet.Range("A1").Select not work!!!
 
I have set all my worksheets as Worksheet objects, and I am trying to
reference a particular cell/range, but the code always bombs out with
a "Select method of Range class failed"...

the line is...

WSStats.Range("A1").Select

Why will this not work?

This works...

WSStats.Activate
Range("A1").Select

But I don't want to "Activate" the worksheet in order to reference the
said cell.

Am I missing something?

Thanks

Don Guillett

Why does Sheet.Range("A1").Select not work!!!
 
You didn't show all of your code so

To SELECT (what you said) you do need to activate after activating the
desired sheet.
application.goto WSStats.Range("A1")
would have worked but to reference withOUT selecting

WSStats.Range("A1").copy range("a1")

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DemonTraitor" wrote in message
...
I have set all my worksheets as Worksheet objects, and I am trying to
reference a particular cell/range, but the code always bombs out with
a "Select method of Range class failed"...

the line is...

WSStats.Range("A1").Select

Why will this not work?

This works...

WSStats.Activate
Range("A1").Select

But I don't want to "Activate" the worksheet in order to reference the
said cell.

Am I missing something?

Thanks



Ron de Bruin

Why does Sheet.Range("A1").Select not work!!!
 
Hi Demon

You can't select a cell on a sheet that is not active
Why do you want to select the cell?

You can always use this to avoid the error

Application.Goto WSStats.Range("A1"), True



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"DemonTraitor" wrote in message ...
I have set all my worksheets as Worksheet objects, and I am trying to
reference a particular cell/range, but the code always bombs out with
a "Select method of Range class failed"...

the line is...

WSStats.Range("A1").Select

Why will this not work?

This works...

WSStats.Activate
Range("A1").Select

But I don't want to "Activate" the worksheet in order to reference the
said cell.

Am I missing something?

Thanks



All times are GMT +1. The time now is 02:13 PM.

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