Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi everyone,
I know you can convert text to numbers with the whole paste multiply by 1 thing but I was wondering if anyone had seen code (or would know what code to use) to convert numbers stored as text to numbers using a custom built VBA function? Any help greatly appreciated! Josh |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure what you mean, but here is a function that will convert a string
value digit to an integer value. Function MakeNum(rng As Range) MakeNum = CInt(rng) End Function To use it, assume a string value of "123456" in cell b5: In an empty cell put formula =MakeNum(b5) Enter. "Josh Craig" wrote in message ... Hi everyone, I know you can convert text to numbers with the whole paste multiply by 1 thing but I was wondering if anyone had seen code (or would know what code to use) to convert numbers stored as text to numbers using a custom built VBA function? Any help greatly appreciated! Josh |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is no direct functions to convert this. For a VBA solution check out
the below links http://support.microsoft.com/kb/213360 http://www.ozgrid.com/VBA/ValueToWords.htm http://www.xldynamic.com/source/xld.xlFAQ0004.html -- Jacob "Josh Craig" wrote: Hi everyone, I know you can convert text to numbers with the whole paste multiply by 1 thing but I was wondering if anyone had seen code (or would know what code to use) to convert numbers stored as text to numbers using a custom built VBA function? Any help greatly appreciated! Josh |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Josh,
There is no way of knowing what you truly mean because you didn't provide an example (as was mentioned in a prior post). However, if you have a numeric value in the spreadsheet and the spreadsheet is treating that numeric value as text, then here are two built-in Excel ways that should get that text into a number. (1) In a separate cell: =NumberTextCell+1-1. Copy (new formula cells)-Paste Special-Values (2) Place a 1 somewhere on the spreadsheet. Copy the 1-select numeric cells that are text-Paste Special-Multiply Best, Matthew Herbert "Josh Craig" wrote: Hi everyone, I know you can convert text to numbers with the whole paste multiply by 1 thing but I was wondering if anyone had seen code (or would know what code to use) to convert numbers stored as text to numbers using a custom built VBA function? Any help greatly appreciated! Josh |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OR do you mean code to conver to numbers
Dim cell As Range For Each cell In Selection If cell.Text < "" And IsNumeric(cell.Value) Then cell.Value = Val(cell.Text) cell.NumberFormat = "General" End If Next -- Jacob "Jacob Skaria" wrote: There is no direct functions to convert this. For a VBA solution check out the below links http://support.microsoft.com/kb/213360 http://www.ozgrid.com/VBA/ValueToWords.htm http://www.xldynamic.com/source/xld.xlFAQ0004.html -- Jacob "Josh Craig" wrote: Hi everyone, I know you can convert text to numbers with the whole paste multiply by 1 thing but I was wondering if anyone had seen code (or would know what code to use) to convert numbers stored as text to numbers using a custom built VBA function? Any help greatly appreciated! Josh |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert numbers stored as text to numbers | Excel Discussion (Misc queries) | |||
Convert numbers stored as text to numbers | Excel Discussion (Misc queries) | |||
Convert numbers stored as text to numbers Excel 2000 | Excel Discussion (Misc queries) | |||
How do I convert numbers stored as text with spaces to numbers | Excel Discussion (Misc queries) |