LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default rng(1,1) syntax doesn't work for set rng = arange.columns(1)

Not sure this is a totally satisfactory explanation, but here's my
best guess. Look at

? Range("B2:B5").Cells.Count, Range("B2:B5").Columns(1).Count
4 1

When you reference the column property, it returns a unit rather
than a range of cells.

Since the

rng(1, 1)

syntax is shorthand for

rng.item(rowindex, columnindex)

syntax, my best guess is that specifying a rowindex is ambiguous and
therefore returns the error.

In article ,
"Tim Zych" wrote:

Anybody know why this doesn't work?

Dim rng As Range
Set rng = Range("B2:X5").Columns(1)
Debug.Print rng.Address '<- this works
Debug.Print rng(1, 1).Address '<-this doesn't

Yes, rng.cells(1,1) does work. What's up with this?

XL2000, Win2000

 
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
Arange sorted data in multiple columns Unknown Excel Discussion (Misc queries) 6 September 6th 07 03:59 AM
Help to adapt Formula syntax to work with Visible Filtered Cells Sam via OfficeKB.com Excel Worksheet Functions 6 September 16th 05 11:42 PM
Help to adapt Formula syntax to work with Dynamic Named Ranges Sam via OfficeKB.com Excel Worksheet Functions 13 April 29th 05 12:36 AM
arange dates kabeer Excel Discussion (Misc queries) 1 April 8th 05 03:15 AM
rng(1,1) syntax doesn't work for set rng = arange.columns(1) Alan Beban[_3_] Excel Programming 2 September 30th 03 11:29 PM


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