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 Accessing Columns by name in a Row loop in VBA

I have a sheet with columns named that I want to access in code. And the
area I want to acees is also named.

I want to be able to write code like this (which is pseudo code of course):

Dim table As Range
table = Sheets("Books").Range("OutOfPrint")

Dim row As Range
For Each row In table
Dim title As String
Set title = row.Column("Title")

Dim cost As Integer
Set cost = row.Column("Cost")
Next row

The bit I don't get is how I can do the Column("<Name") magic. Any ideas?

Thanks,
Tyler
 
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
loop over columns kizzie Excel Discussion (Misc queries) 4 August 10th 05 01:31 PM
incrementing columns in a loop Mitch Excel Programming 1 June 9th 05 03:40 PM
Loop through columns and then rows Sunryzz Excel Programming 8 December 23rd 04 03:13 PM
loop through columns hotherps[_78_] Excel Programming 6 July 23rd 04 11:40 AM
Loop 20 columns Help! Michael168[_106_] Excel Programming 2 July 2nd 04 12:26 PM


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