Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple String Conversion - HELP
Anyone know off-hand the command to convert a number: 0000000456 to: 4.56 I tried this: Application.FixedDecimal = True Application.FixedDecimalPlaces = 2 Which works, but not if you're copying the data from another workbook. Any ideas? Garrett (MIS) -- prepotency ------------------------------------------------------------------------ prepotency's Profile: http://www.excelforum.com/member.php...o&userid=24155 View this thread: http://www.excelforum.com/showthread...hreadid=378042 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple String Conversion - HELP
Dim TempNumber as single TempNumber = "000000456" TempNumber = TempNumber / 100 -- Kaak ------------------------------------------------------------------------ Kaak's Profile: http://www.excelforum.com/member.php...fo&userid=7513 View this thread: http://www.excelforum.com/showthread...hreadid=378042 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple String Conversion - HELP
=VALUE(A1) where A1 has your number 000456 Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=378042 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple String Conversion - HELP
in VBA simply do: a = Int( "0000456") Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=378042 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple String Conversion - HELP
hahahaha wow - didn't even occur to me to divide by 100. That makes me laugh. Here's something else I came up with if anyone needs it later: Sub insertDecimal() Dim theInput As String theInput = "0000000875" Dim leftText, rightText As String leftText = left(theInput, Len(theInput) - 2) rightText = right(theInput, 2) Dim newText newText = leftText + "." + rightText Cells(1, 1).Value = newText End Sub thanks for the replies all -- prepotency ------------------------------------------------------------------------ prepotency's Profile: http://www.excelforum.com/member.php...o&userid=24155 View this thread: http://www.excelforum.com/showthread...hreadid=378042 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
String formula conversion | Excel Discussion (Misc queries) | |||
Simple conversion | Excel Discussion (Misc queries) | |||
String to Variant incorrect conversion | Excel Worksheet Functions | |||
Range < - String conversion. | Excel Programming | |||
String to Array Conversion | Excel Programming |