Excel offers the functions, but who wants to add the Excel object model to their project? One simple way is to use the OCT command and a little conversion to change Decimal based code to Binary.
Public Function ToBinary(ByVal lngDecimalNumber As Long) As String Dim strDecimalNumber As String Dim strReturnValue As String Dim strBinValue As String Dim lngStringLength As Long Dim lngIndex As Long strDecimalNumber = Oct(lngDecimalNumber) lngStringLength = Len(strDecimalNumber) For lngIndex = 1 To lngStringLength Select Case Mid$(strDecimalNumber, lngIndex, 1) Case 0 strBinValue =