Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
String formula conversion Erik Excel Discussion (Misc queries) 1 February 13th 10 01:09 AM
Simple conversion evoxfan Excel Discussion (Misc queries) 4 October 8th 08 11:09 PM
String to Variant incorrect conversion Paul Excel Worksheet Functions 1 October 4th 07 01:11 AM
Range < - String conversion. y Excel Programming 3 April 8th 04 12:01 AM
String to Array Conversion Ussiddiqui[_14_] Excel Programming 1 January 31st 04 10:04 AM


All times are GMT +1. The time now is 05:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"