Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default conversion of text to numeric

In a macro I have the following code

Cells(rs, cl) = Cells(7, 19)

What can I change to this or add after it that will force the numbers
to be numeric instead of string?

Thank you
Larry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default conversion of text to numeric

It normally isn't a problem, but if it is:

With Cells(rs, cl)
.NumberFormat = "General"
.Value = cdbl(Cells(7, 19).Value2)
End With


Assumes cells(7,19) contains a numeric value.
--
Regards,
Tom Ogilvy

"Larry Empey" wrote in message
...
In a macro I have the following code

Cells(rs, cl) = Cells(7, 19)

What can I change to this or add after it that will force the numbers
to be numeric instead of string?

Thank you
Larry



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default conversion of text to numeric

Tom

Thank you it works fine.
You said "It normally isn't a problem" which makes me wonder why it
is.
What I am doing is checking some cells in one part of the worksheet
and if they are < 10 then using cells = cells statement to copy them
to another part of the worksheet. But when I "read" them with another
if statement one or two (out of nine) will appear as "4" instead of 4
Is their something wrong with this method?

Larry



On Mon, 19 Jun 2006 22:53:42 -0400, "Tom Ogilvy"
wrote:

It normally isn't a problem, but if it is:

With Cells(rs, cl)
.NumberFormat = "General"
.Value = cdbl(Cells(7, 19).Value2)
End With


Assumes cells(7,19) contains a numeric value.


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
Data conversion: Text to Numeric to Support Averaging Frogs5 New Users to Excel 1 May 28th 10 03:01 PM
Prevent conversion of numeric text string to scientific notation StuckWithExcelAlas Excel Discussion (Misc queries) 1 December 28th 07 07:02 PM
Numeric in Text to convert back to the form of Numeric for VLookup Purposes achilles Excel Discussion (Misc queries) 4 February 6th 06 07:05 AM
ASCII to Numeric Conversion cincode5 Excel Discussion (Misc queries) 2 August 4th 05 07:25 PM
Text Conversion Michael Rekas[_2_] Excel Programming 2 April 21st 04 05:46 PM


All times are GMT +1. The time now is 10:29 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"