emulating xl consts

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, Is it easy to create custom xl consts that can be used as function
parameters?
At the moment I'm using a standard module containing my initialised
constants but I want the VB editor to prompt with a list of permissible
parameter values as it does for inbuilt functions. (Ideally I would like
something along the lines of:

private sub myFunction(myParameter as myType)
....
end sub

Type myType
myVariable1 as integer = 0
myVariable2 as integer = 1
end Type
)


Any suggestions? Thanks in advance
 
Hi,
Instead of Type , use Enum:

Public Enum myEnum
enumVar1 = 1
enumVar2 = 2
End Enum

Sub test()
Msgbox enumVar1
MsgBox myEnum.enumVar1
End Sub

Regards,
Sebastien
 
Fantastic. Thank you!

sebastienm said:
Hi,
Instead of Type , use Enum:

Public Enum myEnum
enumVar1 = 1
enumVar2 = 2
End Enum

Sub test()
Msgbox enumVar1
MsgBox myEnum.enumVar1
End Sub

Regards,
Sebastien
 

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

Back
Top