Excel 2003 ListObject question

  • Thread starter Thread starter Frederick Chow
  • Start date Start date
F

Frederick Chow

Hi all,

I am new to the ListObject in Excel 2003. Some questions:

1. How to check if an listobject exist in a worksheet?
2. How to determine if the active cell resides on a listobject?
3. How to determine if the active cell resides on a specific listcolumn of
ANY listobject?

Thanks for your help in advance.

Frederick Chow
Hong Kong
 
This will help with the first two questions. I'm sure you'll want to tackle
the third yourself as an exercise.

Sub a()
Dim Counter As Integer
MsgBox "Number of lists on this sheet: " & _
Sheet1.ListObjects.Count
For Counter = 1 To Sheet1.ListObjects.Count
If Not Intersect(ActiveCell, Sheet1.ListObjects(Counter) _
.DataBodyRange) Is Nothing Then
MsgBox "Active cell is in: " & Sheet1.ListObjects(Counter).Name
End If
Next
End Sub


--
Jim
| Hi all,
|
| I am new to the ListObject in Excel 2003. Some questions:
|
| 1. How to check if an listobject exist in a worksheet?
| 2. How to determine if the active cell resides on a listobject?
| 3. How to determine if the active cell resides on a specific listcolumn of
| ANY listobject?
|
| Thanks for your help in advance.
|
| Frederick Chow
| Hong Kong
|
|
 
Hi Jim,

Really thanks for your hint. I will try to work on my remaining problem on
my own.

Frederick Chow
Hong Kong,.
 
Back
Top