ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2003 ListObject question (https://www.excelbanter.com/excel-programming/354621-excel-2003-listobject-question.html)

Frederick Chow

Excel 2003 ListObject question
 
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



Jim Rech

Excel 2003 ListObject question
 
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
"Frederick Chow" wrote in message
...
| 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
|
|



Frederick Chow

Thanks for your help
 
Hi Jim,

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

Frederick Chow
Hong Kong,.

"Jim Rech" wrote in message
...
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
"Frederick Chow" wrote in message
...
| 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
|
|






All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com