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: 2
Default Working with one Column in a Named Range

This must be simple...

I want to iterate across all cells in the second column of a named range
("Data_Range"). The following For-Each does not work...

For Each cell In Range("Data_Range").Columns(2)
Debug.Print cell.Address
Next cell

For each iteration, this prints the address of the entire named range, not
the address of each cell in the range. Why is that?

The following works using the single-parameter version of Cells()...
For i = 1 To Range("Data_Range").Columns(2).Cells.Count
Debug.Print Range("Data_Range").Columns(2).Cells(i).Value
Next I


Steve

 
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
Named Range Links not working Fleone Links and Linking in Excel 1 November 12th 08 07:49 AM
My Dynamic Named Range isn't working Carrie_Loos via OfficeKB.com Excel Worksheet Functions 11 February 22nd 08 10:09 PM
Formula not working when letter A is used in a named range jimar Excel Discussion (Misc queries) 7 July 6th 06 11:43 AM
working with a named range Gixxer_J_97[_2_] Excel Programming 2 June 1st 05 07:44 PM
Create named range for each column not working? Ed Excel Programming 3 January 12th 05 05:57 PM


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