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

D

DemonTraitor

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
 
D

Don Guillett

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")
 
R

Ron de Bruin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top