+ Reply to Thread
Results 1 to 1 of 1

You might need Enum values explained - try this

  1. #1
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    You might need Enum values explained - try this

    Yesterday i was a-Googling (there are other search engines) and came across a very useful page; http://www.datapigtechnologies.com/d...umerations.txt
    that lists MS enumerations, e.g. (a short one):
    Public Enum XlApplyNamesOrder
    xlColumnThenRow = 2
    xlRowThenColumn = 1
    End Enum
    Now one can readily get the value usually hidden by a name. But what if you want the name for a value as I do in my reporter tools? Easy! Place the data in a module (name it XLEnumertions), add a macro to fetch the result and it's done. Here's the code:
    Please Login or Register  to view this content.
    I'm indebted to http://www.cpearson.com/Excel/VBE.aspx for the method in the code.

    This macro assumes these things:
    1. You've reduce the headings at teh top of the module from Datapig to fewer than 4 lines (put comments at the foot of the module after the functin).
    2. 'Trust access to the VBA Project Object model' must be true to allow reading the source directly.
    3. VBA extensibility 5.3 must be referenced in Tools
    Then place the module in your personal workbook, or perhaps an add-in. It is then available to other macros you write. Add project references if needed.
    One odd thing is that the code does read its own module code to get the definitions, thereby not duplicating that data anywhere.
    Last edited by brynbaker; 08-09-2013 at 06:46 AM. Reason: furthe info

+ 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. Enum: use same user-defined name in 2 Enum's
    By onidarbe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2013, 11:25 AM
  2. Not sure if its explained well, but hope it can be done....
    By Joe O Ceadaigh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-29-2012, 01:50 PM
  3. need help with a v lookup formula, just need it to be explained
    By damagedbodies in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-12-2010, 01:08 PM
  4. DLL's explained?
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2008, 08:28 AM
  5. Counting Formulas -- Re-explained
    By MAB in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2006, 05:25 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