Some people misunderstood of function CDec():

CDec() is a function to convert a value of any data type that can be recognised as a number to subtype Decimal of type Variant.
A Decimal subtype value can hold up to 28 digits (left+right of decimal point).
Ex.:
Code:
Dim d1 As Variant, d2 As Variant
d1 = CDec("1234567890123456789012345678")
d2 = CDec(123456789012345#) * CDec(678901.2345678#)
Hex$() is a function to convert a Long to a String under Hexadecimal notation that uses 16 digits 0...9A...F.

Ex.: "1F" is Hex String of Long integer 31

&H30A is another way to write 778 in VB: n = &H30A and n = 778 mean exactly the same thing in VB.

In case if we have an arbitrary String under Hex format and want to convert to a Long value, this is the way to convert a Hex String to a Long:
Code:
Dim S As String, n As Long, H as String
S = "30A" 
n = CLng("&H" & S) ' = 778
'-- and convert back a Long to Hex String:
H = Hex$(n + 20) ' = Hex$(798) = "31E"