+ Reply to Thread
Results 1 to 2 of 2

Help with table reference

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Help with table reference

    I have the following code as part of a macro.
    ...Begin code
    Range("Table13[[#Headers],[County]]").Select
    Selection.Copy
    Range("Table13[[#Headers],[Order ]:[TD Recording '#]]").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    End Sub
    ...End code

    Obviously the macro runs correctly if I am on the sheet where the table name = Table13. If I run the macro on another sheet, it won't complete because the Table name is different. How do I change the above so it will run regardless of what sheet I am on and not be table specific? The workbook can contain many worksheets, however, the column names are identical from sheet to sheet. Hope this makes sense...

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Help with table reference

    See if this will get you going ...

    Please Login or Register  to view this content.

    Regards, TMS
    Last edited by TMS; 11-19-2013 at 06:05 PM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. [SOLVED] fill reference table based on data available in master Table
    By jsimha in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-31-2013, 12:19 PM
  2. Reference / retrieve data from a table and populate a table in a different workbook?
    By philuptuous in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-17-2012, 06:21 AM
  3. Buttons in table reference cells in table
    By Alkuan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2012, 12:07 PM
  4. Replies: 3
    Last Post: 05-13-2009, 11:51 PM
  5. [SOLVED] VBA Code for a pivot table to open database and to reference table current page
    By Pete Straman Straman via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-21-2005, 12:06 AM

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