Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
dec2bin
Hi
Is there something analagous to dec2bin (worksheet) for VBA? I need to change a 5 digit decimal into a 16 character binary expression. Thanks Jo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
dec2bin
this should do.. Function DecToBin(ByVal Number As Long, _ Optional Places As Integer) As String Dim l As Long, s As String l = Number Do s = (l Mod 2) & s l = l \ 2 Loop While l 0 If Places 0 And Places Len(s) Then s = String$(Places - Len(s), "0") & s End If DecToBin = s End Function -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Jo wrote : Hi Is there something analagous to dec2bin (worksheet) for VBA? I need to change a 5 digit decimal into a 16 character binary expression. Thanks Jo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What 'value' is a Dec2Bin output? | Excel Discussion (Misc queries) | |||
=Dec2bin can you increase the number bits please | Excel Discussion (Misc queries) | |||
How to get leading zeros using DEC2BIN | Excel Worksheet Functions | |||
Base number functions, example DEC2BIN | Setting up and Configuration of Excel | |||
Dec2Bin Function Max length of 16 bits | Excel Programming |