Consulting

Results 1 to 5 of 5

Thread: Solved: VBA alternative to a look up table

  1. #1

    Solved: VBA alternative to a look up table

    Hi,

    Is there a VBA alternative to using a frequently used look up table? E.g. In the look up table there would be 2 columns Directorate & DirCode, where Directorate is a full name and DirCode a code (in reality there would be further columns for other organisational levels).

    Instead of me having to navigate to and open the file with the look up table, and then write out the vlookup formula, can I store this table in VBA and use it from there?

    Many thanks.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You could read it in on workbook open, store in on a hidden sheet with a defined name, and use that name in the formulae.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Could that be stored in a PERSONAL file?

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You could, but personally I would not. You could however save it in another Hidden workbook saved in your XLStart folder. That would give similar access to the data.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Ok, thanks guys. I'll look into these options.

Posting Permissions

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