Hi everyone,
I need some help with correcting, a macro, someone already looked at it and told me that this macro is correct but can not handle big number !!!
So what I need is for this macro be able to transfer any number from 1 to 575757 and higher if possible ? for the game 5/39.
Here it is :
Function D2B(ByVal n As Long) As String
n = Abs
D2B = ""
Do While n > 0
If n = (n \ 2) * 2 Then
D2B = "0" & D2B
Else
D2B = "1" & D2B
n = n - 1
End If
n = n / 2
Loop
End Function
I have in column " I " all my Lexicographic numbers and in column " K " the Binary code of this Lexicographic number which total of 20 digits.
I have a second question :
I need each of those Binary code number to have their digits brook down, in separated cell ( 1 digit per cell ), so starting in cell O5 and up to AH5 I have this formula but it doesn't work for the last 4 digits ??
Here is the formula : =VALUE(MID(TEXT($K5,"000000000000000000000"),CELL("col",O5)-CELL("col",$K5),1))
So if someone can help, I would really appreciate it,
Thank you all.
Serge.
I need some help with correcting, a macro, someone already looked at it and told me that this macro is correct but can not handle big number !!!
So what I need is for this macro be able to transfer any number from 1 to 575757 and higher if possible ? for the game 5/39.
Here it is :
Function D2B(ByVal n As Long) As String
n = Abs
D2B = ""
Do While n > 0
If n = (n \ 2) * 2 Then
D2B = "0" & D2B
Else
D2B = "1" & D2B
n = n - 1
End If
n = n / 2
Loop
End Function
I have in column " I " all my Lexicographic numbers and in column " K " the Binary code of this Lexicographic number which total of 20 digits.
I have a second question :
I need each of those Binary code number to have their digits brook down, in separated cell ( 1 digit per cell ), so starting in cell O5 and up to AH5 I have this formula but it doesn't work for the last 4 digits ??
Here is the formula : =VALUE(MID(TEXT($K5,"000000000000000000000"),CELL("col",O5)-CELL("col",$K5),1))
So if someone can help, I would really appreciate it,
Thank you all.
Serge.