Excel 2003 ListObject question

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
 
J

Jim Rech

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
|
|
 
F

Frederick Chow

Hi Jim,

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

Frederick Chow
Hong Kong,.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top