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:
I'm indebted to http://www.cpearson.com/Excel/VBE.aspx for the method in the code.
This macro assumes these things:- 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).
- 'Trust access to the VBA Project Object model' must be true to allow reading the source directly.
- 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.
Bookmarks