Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Scope of name ranges to particular worksheet AZSteve Excel Discussion (Misc queries) 2 May 1st 10 01:13 PM
Name scope within a workbook Christer Excel Discussion (Misc queries) 0 March 24th 10 10:32 PM
pivot tables across sheets in a workbook NICK Excel Discussion (Misc queries) 2 June 10th 09 02:01 PM
Deleting all named ranges that have a workbook scope Babymech Excel Discussion (Misc queries) 3 February 19th 09 04:21 PM
Referring to all pivot tables in a workbook klysell Excel Programming 3 August 1st 07 09:52 PM


All times are GMT +1. The time now is 09:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"