If just whole numbers then
Code:
Private Sub Form_Load()
Dim strBinary As String
strBinary = Oct(12345)
strBinary = Replace(strBinary, "0", "000")
strBinary = Replace(strBinary, "1", "001")
strBinary = Replace(strBinary, "2", "010")
strBinary = Replace(strBinary, "3", "011")
strBinary = Replace(strBinary, "4", "100")
strBinary = Replace(strBinary, "5", "101")
strBinary = Replace(strBinary, "6", "110")
strBinary = Replace(strBinary, "7", "111")
Debug.Print strBinary
Dim lngPos As Long
Dim strOct As String
If Len(strBinary) Mod 3 > 0 Then 'add leading zeroes
strBinary = String(3 - (Len(strBinary) Mod 3), "0") & strBinary
End If
strOct = "&O"
For lngPos = 1 To Len(strBinary) Step 3
Select Case Mid$(strBinary, lngPos, 3)
Case "000": strOct = strOct & "0"
Case "001": strOct = strOct & "1"
Case "010": strOct = strOct & "2"
Case "011": strOct = strOct & "3"
Case "100": strOct = strOct & "4"
Case "101": strOct = strOct & "5"
Case "110": strOct = strOct & "6"
Case "111": strOct = strOct & "7"
End Select
Next
Debug.Print CLng(strOct)
End Sub
I used octet to limit test to 8 combinations instead of 16 with hex.