Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Numerals conversion
Hi,
Does somebody have any idea about how to develop some VBA function or macro aiming conversion of several numerals types and that could be used for small and large numbers(e.g. 100000000000 in decimal)? The major numerals base for which I need this conversions a Binary (Base 2) Ternary (Base 3) Quaternary (Base 4) Quinary (Baase 5) Senary (Base 6) Septenary (Base 7) Octal (Base 8) Nonary (Base 9) Decimal (Base 10) Undecimal (Base 11) Duodecimal (Base 12) Base 13 Hexadecimal (Base 16) Vigesimal (Base 20) Thanks in advance, Luciano |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Numerals conversion
Hi there Luciano
Not sure if I am reading right or not. Have a look at the following, it may point you in the right direction. It assumes your numbers you want to convert are in Column "B", so anytime you enter the base value you have presented the adjacent cell will change its decimal count to the number entered. I may have misinterpreted what it is you're needing, but someone else may have another idea for you to run with. HTH Mick. Private Sub Worksheet_Change(ByVal Target As Range) Dim r As Long If Not Intersect(Target, Range("A1:A20")) Is Nothing Then Select Case True Case Target.Value = 2 With ActiveCell .Offset(0, 1).NumberFormat = "0.00" End With Case Target.Value = 3 With ActiveCell .Offset(0, 1).NumberFormat = "0.000" End With Case Target.Value = 4 With ActiveCell .Offset(0, 1).NumberFormat = "0.0000" End With Case Target.Value = 5 With ActiveCell .Offset(0, 1).NumberFormat = "0.00000" End With Case Target.Value = 6 With ActiveCell .Offset(0, 1).NumberFormat = "0.000000" End With Case Target.Value = 7 With ActiveCell .Offset(0, 1).NumberFormat = "0.0000000" End With Case Target.Value = 8 With ActiveCell .Offset(0, 1).NumberFormat = "0.00000000" End With Case Target.Value = 9 With ActiveCell .Offset(0, 1).NumberFormat = "0.000000000" End With Case Target.Value = 10 With ActiveCell .Offset(0, 1).NumberFormat = "0.0000000000" End With Case Target.Value = 11 With ActiveCell .Offset(0, 1).NumberFormat = "0.00000000000" End With Case Target.Value = 12 With ActiveCell .Offset(0, 1).NumberFormat = "0.000000000000" End With Case Target.Value = 16 With ActiveCell .Offset(0, 1).NumberFormat = "0.0000000000000000" End With Case Target.Value = 20 With ActiveCell .Offset(0, 1).NumberFormat = "0.00000000000000000000" End With Case Else r = MsgBox("You Need to enter a number between 2 & 20") End Select End If End Sub |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Numerals conversion
Hey there Luciano
I do not respond to direct mail, unless invited. The reason for this apart from Newsgroup Etiquette is that others whom may have a similar need miss out. I see you have a few responses to your other thread so will discontinue this on. Cheers Mick. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sub/superscript numerals in UNICODE | Excel Programming | |||
Relating numerals as text | Excel Discussion (Misc queries) | |||
changing text to numerals | Excel Worksheet Functions | |||
How do I display numerals (5) as words (five)? | Excel Discussion (Misc queries) | |||
Numerals changing | Excel Discussion (Misc queries) |