+ Reply to Thread
Results 1 to 4 of 4

data table - scope to sheet ??

  1. #1
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Poland
    MS-Off Ver
    MS Office 365
    Posts
    174

    data table - scope to sheet ??

    Hi

    I have excel workbook with one sheet named “my_sheet_1”. There is data table named “my_table” inside this sheet.


    I use this table in VBA referring by “vba_table_1”:
    Please Login or Register  to view this content.
    I would like to copy and paste this sheet inwardly my one workbook using VBA and referring table by “vba_table_2”.


    I can copy sheet and set it name to “my_sheet_2” but cannot set “vba_table_2”, because “my_table” name is being changed after sheet copy and I do not know what table name will be after it:
    Please Login or Register  to view this content.


    The best way would be to set table scope to worksheet instead of workbook but is there any way to do it??

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: data table - scope to sheet ??

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Poland
    MS-Off Ver
    MS Office 365
    Posts
    174
    Thx

    But if I have mire then one table in my_sheet ?

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: data table - scope to sheet ??

    The newest one will have the highest index, which will be - ThisWorkbook.Sheets(“my_sheet_2”).ListObjects.Count - which is why my code will pick out the table just added to the sheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Data validation with named ranges doesn't work outside scope sheet
    By aprimak in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-05-2015, 11:59 AM
  2. Replies: 0
    Last Post: 01-26-2015, 05:31 PM
  3. ActiveX change event firing in sheet destructor when object already out of scope
    By andre.hendriks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2014, 05:13 AM
  4. Replies: 3
    Last Post: 01-07-2014, 06:13 AM
  5. Replies: 1
    Last Post: 11-28-2013, 02:10 AM
  6. Replies: 0
    Last Post: 05-21-2013, 03:09 PM
  7. [SOLVED] Query Table Ranges, Not Within Scope of Workbook
    By gjohn282 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-14-2013, 09:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1