trouble w/ creating a VBA function that uses an enum in it's parameters

J

jacob

Greetings,

I have an enum that I use as a variable in a function. If I call on
the function from w/in the VBA IDE, the enum values are displayed, but
not when I call on the function from w/in Excel.

I have tried all sorts of things, but I am at my wit's end. Here is
the code...

Public Enum To_Unit
eMinute = 1
eHour = 2
eDay = 3
eWeek = 4
eMonth = 5
End Enum

Public Function ChangeUnit(Target As Range, ToUnit As To_Unit) As Long


Thanks in advance,
Jacob
 
R

Rob Bovey

Hi Jacob,

If you mean that Excel doesn't display the text values of your
enumeration members when you use your function as a worksheet function, it's
because Excel doesn't support this feature for worksheet functions.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top