Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tkaplan
 
Posts: n/a
Default range("a1").select not working


I have a line in my code:

Sheets("CT Summary").Select
Range("A1").Select

when i run my code, the debugger stops at the range.select line. the
cell is not hidden, the sheets are not protected.
the error i get is:
runtime error 1004: select method of Range class failed.

i cant figure out what is wrong with this. any suggestions?


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=479822

  #2   Report Post  
Randall Arnold
 
Posts: n/a
Default range("a1").select not working

Try this:

Sheets("CT Summary").Activate
Activesheet.Range("A1").Select

Randall Arnold

"tkaplan" wrote:


I have a line in my code:

Sheets("CT Summary").Select
Range("A1").Select

when i run my code, the debugger stops at the range.select line. the
cell is not hidden, the sheets are not protected.
the error i get is:
runtime error 1004: select method of Range class failed.

i cant figure out what is wrong with this. any suggestions?


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=479822


  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default range("a1").select not working

I'm guessing that this code is behind a worksheet.

Unqualifed ranges in that kind of module refer to the sheet that owns the code.
And I'm guessing that "CT Summary" isn't the sheet that owns that code.

You could use:
Sheets("CT Summary").Select
Sheets("CT Summary").range("a1").select

or
application.goto Sheets("CT Summary").range("a1"),scroll:=true

But you don't usually have to select a range to work with it.

Sheets("CT Summary").range("a1").value = "hi there"

is one way to assign a value directly to that cell.

tkaplan wrote:

I have a line in my code:

Sheets("CT Summary").Select
Range("A1").Select

when i run my code, the debugger stops at the range.select line. the
cell is not hidden, the sheets are not protected.
the error i get is:
runtime error 1004: select method of Range class failed.

i cant figure out what is wrong with this. any suggestions?

--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=479822


--

Dave Peterson
  #4   Report Post  
tkaplan
 
Posts: n/a
Default range("a1").select not working


thank you dave. You're right (again). CT summary does not own that
code. I moved the code to a macro and called the macro and now it
works:)

thank you for the explanation though. I never knew that and it was
driving me insane that it wasnt working. but now i know why:)


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=479822

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
Working days left in the month compared to previous months qwopzxnm Excel Worksheet Functions 8 October 24th 05 08:00 PM
How to project the due date according to a number of working hours Eric Excel Worksheet Functions 1 October 21st 05 03:03 PM
Working time and days Nortos Excel Worksheet Functions 5 May 6th 05 04:17 PM
Working time and days Nortos Excel Discussion (Misc queries) 1 May 6th 05 03:47 PM
Trace Dependents and Precedents not working Manish Excel Worksheet Functions 0 April 11th 05 09:39 PM


All times are GMT +1. The time now is 08:59 PM.

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

About Us

"It's about Microsoft Excel"