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: 27,285
Default rng(1,1) syntax doesn't work for set rng = arange.columns(1)

You have a column object:

? Range("B2:X5").Columns(1).count
1

See, the count is 1

Adding cells drills into the cells within the column object:
? Range("B2:X5").Columns(1).cells.count
4

so adding cells refers to B2:B5 as individual cells while the original
refers to the 1st column in B2:X5.

--
Regards,
Tom Ogilvy


"Tim Zych" wrote in message
...
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 Dynamic Named Ranges Sam via OfficeKB.com Excel Worksheet Functions 13 April 29th 05 12:36 AM
rng(1,1) syntax doesn't work for set rng = arange.columns(1) Vasant Nanavati[_2_] Excel Programming 0 October 1st 03 03:12 AM
rng(1,1) syntax doesn't work for set rng = arange.columns(1) J.E. McGimpsey Excel Programming 2 October 1st 03 12:28 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 11:16 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"