LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Range(0,0).Select ?

Range(0, 0).Select

It is bad code. The syntax

Range(x,y)

will fail if x and y are any numbers.




--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Bill Martin" wrote in message
...
I have a macro I inherited with the code fragment below. I find
that if I
comment out the "on error" statement, the program fails at the
line
"Range(0,0).Select" with the Run-time error '1004': Method
'Range' of object
'_Global' failed.

Excel seems to think the Range line causes a error, yet if I
comment out the
Range line, the program fails to work so it is apparently doing
*something*.
The error handler simply says Resume Next so it's not doing
anything obvious (to
me anyhow).

On Error GoTo ErrorHandler
... (many lines of code) ...
Set DataSheet = ActiveSheet
DataSheet.Unprotect
Range(0, 0).Select

Can someone explain to me the logic of this fragment? I've
been unsuccessful
with the Excel Help system and with my normal reference books.
I would have
thought it was just the equivalent of Range("A1").select, but
apparently not.

Thanks...

Bill





 
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
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Compare a selected Range with a Named range and select cells that do not exist PCLIVE Excel Programming 1 October 18th 05 07:09 PM
Select Sheet then Select Range Gee[_2_] Excel Programming 3 May 27th 04 10:10 PM
Range Select mb Excel Programming 1 February 29th 04 03:26 PM


All times are GMT +1. The time now is 08:47 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"