#1
|
|||
|
|||
Different ways to access ListObject Headers???
In VBA,
I know we can do things like: Code:
Range("oTable[header1]').Select But how about Code:
[oTable].Select ''' anything like this??? [oTable["header1"]].Select ''' return error |
#2
|
||||
|
||||
You can access it via a ListObject object, for example:
Code:
Worksheets("Sheet1").ListObjects("oTable").ListColumns("Header1").Range.Cells(1).Select Code:
[oTable[[#Headers],[Header1]]].Select |
#3
|
|||
|
|||
Quote:
|
#4
|
||||
|
||||
Why do you want to select a particular header cell in the first place?
|
#5
|
|||
|
|||
Quote:
Code:
.Select |
#6
|
||||
|
||||
Okay, this will give you the index of the column within the table itself:
Code:
Debug.Print Sheet1.ListObjects("oTable").ListColumns("Header1").Index Code:
Debug.Print Sheet1.ListObjects("oTable").ListColumns("Header1").Range.Column |
#7
|
|||
|
|||
Quote:
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need headers on each sheet | Mendopaul | Excel | 0 | 02-21-2012 05:51 PM |
Searching A Database Two Ways | skoz55 | Excel | 3 | 11-10-2011 01:01 AM |
Creative Ways for a year-to-year comparison??? | ridonkulous5 | Excel | 1 | 03-23-2011 04:49 PM |
Access 2007 Upgrade After Initial Install - Access 2003 Won't Remove | wcb | Office | 1 | 01-25-2010 04:08 AM |
Help with headers | Bill | Word | 0 | 03-10-2009 05:15 AM |