Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Convert text to Number


so after:

VBA Code:
--------------------


oRange.Value = TheArray
--------------------



just have:

VBA Code:
--------------------


Orange.Value = Orange.Value
--------------------



you could also temporarily put the line:

VBA Code:
--------------------


Orange.numberformat = "General"
--------------------


before the -orange.value = orange.value- line but I'd expect you
wouldn't need that after the first run, especially if there are special
formats you want to keep in that range?

Anyway, try it and see, fingers crossed. At least it should be quick.

Afterthought: you don't have to do this for the whole range, you could
do it for just a few columns:

VBA Code:
--------------------


Orange.columns(2).value = Orange.columns(2).value
--------------------


or for mo

VBA Code:
--------------------


Set rngToMakeNos = Union(orange.Columns(3), orange.Columns(5), orange.Columns(7))
rngToMakeNos.Value = rngToMakeNos.Value
--------------------







JoeBoynton;705723 Wrote:

I'll try your suggestion later, couldnt just now
btw i converted the cells from text to number 1 by 1 as follows:

Dim oRange = oWs.Range("A1").Resize(reszRow, rs.Fields.Count)
oRange.Value = TheArray

' rs is from legacy Acucobol vision files read with odbc/dao off of
Linux server

For myOrRow = 1 To ArrayRowCount + 1

' Extra row count above because I loaded headers into row 1

For myOrColumn = 1 To rs.Fields.Count
If IsNumeric(oRange(myOrRow, myOrColumn).Value) Then
oRange(myOrRow, myOrColumn).Value = oRange(myOrRow,
myOrColumn).Value.ToString * 1
End If
Next
Next

This seems to fix the problem, but its a time killer cause it's cell by

cell[color=blue]

Thx for suggestions

"p45cal" wrote:


How are you getting the numbers-stored-as text into cells to test?
I'll do the same and test again..




Peter T;705601 Wrote:

Not here it doesn't -:)

Regards,
Peter T


"p45cal" wrote in message
...

the likes of:


VBA Code:
--------------------


Range("A1:M200")=Range("A1:M200").value
--------------------



seems to work here.


JoeBoynton;705352 Wrote:

Hi,
I need help on how to automate the conversion of a range of

Excel


--
p45cal

*p45cal*

------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?u=558
View this thread: 'Excel Convert text to Number - The Code Cage

Forums' (http://www.thecodecage.com/forumz/sh...d.php?t=197375)

'Microsoft Office Help - Microsoft Office Discussion - Excel VBA

Programming - Access Programming' (http://www.thecodecage.com/forumz)

.



--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?u=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=197375

http://www.thecodecage.com/forumz

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
how do I convert number to text in excel Medegypt Excel Programming 3 February 26th 09 09:43 PM
number convert to text in excel sugu Excel Discussion (Misc queries) 0 August 23rd 06 11:52 AM
How do I convert a number in Excel to text? Hoff Excel Worksheet Functions 2 March 23rd 06 11:27 PM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM
convert number to text in Excel Canscat1 Excel Programming 3 November 10th 04 12:31 PM


All times are GMT +1. The time now is 01:17 PM.

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

About Us

"It's about Microsoft Excel"