Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scope of Tables Is Workbook, Not WorkSheet
If you use tables in Excel 2007, you may find this useful to know: The scope
of a table is "WorkBook", not "WorkSheet". This is unexpected. In VBA, to refer to a table (a "list" in earlier versions of Excel), its worksheet object must be specified, as in the following: Debug.Print ActiveSheet.ListObjects("Schedule").Name This suggests that the scope is WorkSheet. However, the Name Manager, on the Formulas tab, shows that the scope is WorkBook. To demonstrate that that is the case, copy a worksheet containing a table (leave both versions in the same workbook). The tables in the copy are renamed. For example, in my case, the table "Schedule" was renamed "Schedule10" on the copied sheet. Consequently, the line of code above won't work on a copy of the original sheet. That makes tables less powerful than they could have been, at least from the point of view of VBA programming. I wish Microsoft would consider changing that behavior in a Service Pack. Chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Setting Scope of name ranges to particular worksheet | Excel Discussion (Misc queries) | |||
Name scope within a workbook | Excel Discussion (Misc queries) | |||
pivot tables across sheets in a workbook | Excel Discussion (Misc queries) | |||
Deleting all named ranges that have a workbook scope | Excel Discussion (Misc queries) | |||
Referring to all pivot tables in a workbook | Excel Programming |