View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default Syntax for using table and column names

Depends on what you are trying to do. Maybe...
'--
Sub EOQ()
ActiveSheet.ListObjects(1).Range.Columns(1).Value = "No Name"
ActiveSheet.ListObjects(1).Range.Columns(2).Value = 0
End Sub
'--
Curious... did you publish the list in order to name it, use code or something else?
--
Jim Cone
Portland, Oregon USA



"James O. Thompson"

wrote in message
I can't figure out the syntax to use table and column names.

Assume I have a worksheet named "ClubMembers" containing a table named
"Members" with columns "Name" and "Number". Here is a simplified snippet
illustrating a dumb way to refer to them. How do I use table and column
names more elegantly?

Dim oListRow As ListRow
For Each oListRow In _
Worksheets("ClubMembers").ListObjects("Members").L istRows
oListRow.Range.Cells(1, 1) = "No Name"
oListRow.Range.Cells(1, 2) = 0
Next oListRow

Thanks for your help,
Jim Thompson