Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select Method Failing


Does anyone know a common cause of/solution to the Select Method of
Range Object failing. I'm running this code during the deactivat
subfunction:

cRow = Range("$A:$A").Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(2, 1), Cells(cRow, 2)).Select

This code worked last week, but this week it has decided to break.

Cheers-
Chris Krah

--
cmk1
-----------------------------------------------------------------------
cmk18's Profile: http://www.excelforum.com/member.php...nfo&userid=604
View this thread: http://www.excelforum.com/showthread.php?threadid=38624

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Select Method Failing

When you set a breakpoint and step through the code, what does cRow
evaluate to?

In article ,
cmk18 wrote:

Does anyone know a common cause of/solution to the Select Method of a
Range Object failing. I'm running this code during the deactivate
subfunction:

cRow = Range("$A:$A").Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(2, 1), Cells(cRow, 2)).Select

This code worked last week, but this week it has decided to break.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Select Method Failing

The deactivate event fires after the sheet with the code has lost the focus.
Thus you get the error because you can not select on that sheet.

As written, you must be mistaken. It has probably never worked in the
deactivate event.

It is unclear where you are trying to select so not sure what to recommend.

--
Regards,
Tom Ogilvy

"cmk18" wrote in
message ...

Does anyone know a common cause of/solution to the Select Method of a
Range Object failing. I'm running this code during the deactivate
subfunction:

cRow = Range("$A:$A").Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(2, 1), Cells(cRow, 2)).Select

This code worked last week, but this week it has decided to break.

Cheers-
Chris Krahe


--
cmk18
------------------------------------------------------------------------
cmk18's Profile:

http://www.excelforum.com/member.php...fo&userid=6047
View this thread: http://www.excelforum.com/showthread...hreadid=386242



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
Publish method failing, can't understand why Mark Excel Programming 0 June 22nd 05 07:52 PM
Select Method of Sheets Brenda Meza via OfficeKB.com Excel Programming 2 May 20th 05 12:37 AM
Excel Copy Method Failing. [email protected] Excel Programming 2 May 11th 05 06:01 PM
select method of range class failing ? mark kubicki Excel Programming 6 April 21st 05 05:38 PM
add method of validation failing mark kubicki Excel Programming 2 April 19th 05 08:08 PM


All times are GMT +1. The time now is 11:24 AM.

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"