Select a range in an unselected cell

  • Thread starter Thread starter elaine
  • Start date Start date
E

elaine

Can anyone tell me why doesn't work:

Range(Sheets("Word Analysis").Range("A2"), Sheets("KeyWord
Analysis").Range("A2").End(xlDown)).EntireRow.Select

when this does:
Range(Sheets("Word Analysis").Range("A2"), Sheets("KeyWord
Analysis").Range("A2").End(xlDown)).EntireRow.Delete shift:=xlUp

I just want to select a cell on a different sheet!

it keeps giving me this error code:
Runtime error '1004':
Select method of Range class failed

I just want to select a cell on a different sheet!
I cant even get a basic reference like:

Worksheets("Keyword").Range("A1").Select

to work unless I am already on the "Keyword" worksheet.

Thanks.
 
Activate the sheet first

With Worksheets("Keyword")
.Visible = True
.Activate
.Range("A1").Select
End With
 
How do i get this to work? sorry for all the questions

the selection is on a currently selected worksheet that isn't "word
list"

Selection.Copy Destination:=Sheets("Word List").ActiveCell
 
Elaine,

You cannot Select a cell if the worksheet containing that cell is not
active. You must select the sheet first, then the cell. E.g.,

Worksheets("Sheet2").Select
Range("A10").Select

or

Dim Rng As Range
Set Rng= Worksheets("Sheet1").Range("A10")
Rng.Worksheet.Select
Rng.Select

As an alternative, you can use Application.Goto:

Dim Rng As Range
Set Rng = Worksheets("Sheet1").Range("A10")
Application.Goto Rng, True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
In the first example you are selecting something. In the 2nd, you are not.
To select something, the sheet must be active.

No need to select the range anyway. I think you want something like:

With WorkSheets("Word Analysis")
.Range(.Range("A2"), .Range("A2").End(xlDown)).Copy
Destination:=WorkSheets("??").Range("A2")
End With
 

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

Back
Top