Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Select a range in an unselected cell

Can anyone tell me why doesn't work:

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

when this does:
Range(Sheets("Word Analysis").Range("A2"), Sheets("KeyWord
Analysis").Range("A2").End(xlDown)).EntireRow.Dele te 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Select a range in an unselected cell

Activate the sheet first

With Worksheets("Keyword")
.Visible = True
.Activate
.Range("A1").Select
End With

"elaine" wrote in message
ps.com...
Can anyone tell me why doesn't work:

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

when this does:
Range(Sheets("Word Analysis").Range("A2"), Sheets("KeyWord
Analysis").Range("A2").End(xlDown)).EntireRow.Dele te 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Select a range in an unselected cell

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Select a range in an unselected cell

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)


"elaine" wrote in message
ps.com...
Can anyone tell me why doesn't work:

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

when this does:
Range(Sheets("Word Analysis").Range("A2"), Sheets("KeyWord
Analysis").Range("A2").End(xlDown)).EntireRow.Dele te 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.


  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Select a range in an unselected cell

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



"elaine" wrote in message
ps.com...
Can anyone tell me why doesn't work:

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

when this does:
Range(Sheets("Word Analysis").Range("A2"), Sheets("KeyWord
Analysis").Range("A2").End(xlDown)).EntireRow.Dele te 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting in a Pivot Table unselected fields Marc Excel Worksheet Functions 1 May 15th 10 12:20 AM
NEED VBA TO SELECT A CELL; NOTE THE CELL VALUE;COPYADJ CELL;FIND CELL VALUE IN A RANGE AND SO ON CAPTGNVR Excel Programming 2 July 8th 07 04:18 PM
Delete Unselected Rows Richard Excel Discussion (Misc queries) 2 August 23rd 06 04:24 PM
Select last cell in range PaulSin Excel Programming 3 June 8th 04 10:59 AM
how to delete unselected columns in a table, thanks Kortrijker Excel Programming 2 February 26th 04 04:22 PM


All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"