
Originally Posted by
Dnereb
Thanks to both of you, I hoped there was an way to compare to them all at once. but that seems to be wishfull thinking.
Sure there is! 
VB Code:
Public Enum EnumBaseKeys
[_ENUMBASEKEYS_FIRST] = &H80000000
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001
HKEY_LOCAL_MACHINE = &H80000002
HKEY_USERS = &H80000003
[_ENUMBASEKEYS_LAST] = &H80000003
End Enum
' .......
Public Function Makekey(Optional Hkey As EnumBaseKeys, Optional Subkey As String) As Boolean
If ((Hkey >= [_ENUMBASEKEYS_FIRST]) And (Hkey <= [_ENUMBASEKEYS_LAST]) Then
' ...
End If
End Function
The brackets around the FIRST and LAST members hide them from the Intellisense menu, so you won't accidentally use them when assigning values