+ Reply to Thread
Results 1 to 1 of 1

Indirectly Referencing Table Headers in VBA

  1. #1
    Registered User
    Join Date
    07-14-2014
    Location
    Ontario, Canada
    MS-Off Ver
    MS Office 2010
    Posts
    15

    Indirectly Referencing Table Headers in VBA

    Hey All,

    I have a formula in my worksheet that uses InDirect to "slide" along the table headers to get to the correct column to Index/Match, this is the formula...


    =IF(Category2Dropdown="","#N/A",INDEX(Category2Table[F1],MATCH(Category2Dropdown,INDIRECT("Category2Table["&Category1Dropdown&"]"),0)))

    This is all a part of 3 'dropdowns' that dependent on each other, I got the first to work in VBA, but it doesn't "slide" across to the appropriate header. For 'dropdown 2 & 3' I can't get the indirect portion to work. Here is the code I used to get the Category 1 dropdown to work...


    Dim Cat1 As Variant

    Cat1 = Application.Index(Range("Category1Table[Column1]"), _
    Application.Match(ComboBox1.Value, Range( _
    "Category1Table[Category1]"), 0), 1)

    I've attached the worksheet to hopefully give you a better idea of what I'm struggling with. The important part is at the bottom of the code in the userform, and the example of how it works without VBA is in cells AG2:AI2, which are referencing the sheet 'Imported Product Groups'.

    Any advice or solutions you guys could offer would be greatly appreciated, this has already taken up my entire morning

    Thank you
    Attached Files Attached Files
    Last edited by MrCD; 11-24-2014 at 05:52 PM. Reason: solved

+ 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. Replies: 9
    Last Post: 11-19-2014, 04:15 PM
  2. Indirectly referencing the name of a named range
    By dustinseely in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2012, 08:54 PM
  3. [SOLVED] Indirectly referencing a worksheet within a formula
    By hackwill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-26-2012, 07:22 PM
  4. [SOLVED] Indirectly Referencing Another Workbook
    By RogueArchon in forum Excel General
    Replies: 5
    Last Post: 07-20-2012, 03:51 PM
  5. Replies: 14
    Last Post: 09-05-2005, 11:05 AM

Tags for this Thread

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