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

In Excel2000, what is the best way to code a macro that will convert a
column of text to values. For example, I have the following in column
A:

'100
'1000
'20

I want this to be converted to values like this:

100
1000
20

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default text to values

Snax,

You could use a formula such as in cell B1

=RIGHT(A1,LEN(A1)-1) where A1 was your '100 value.

Just copy the formula down.

In essence, it says, take the right most characters, except the very first
charcter (length - 1).

Hope that helps.

Regards,
Kevin





"snax500" wrote in message
om...
In Excel2000, what is the best way to code a macro that will convert a
column of text to values. For example, I have the following in column
A:

'100
'1000
'20

I want this to be converted to values like this:

100
1000
20

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default text to values

Sorry, disregard my answer...not a macro.

Kevin


"Kevin Stecyk" wrote in message
...
Snax,

You could use a formula such as in cell B1

=RIGHT(A1,LEN(A1)-1) where A1 was your '100 value.

Just copy the formula down.

In essence, it says, take the right most characters, except the very first
charcter (length - 1).

Hope that helps.

Regards,
Kevin





"snax500" wrote in message
om...
In Excel2000, what is the best way to code a macro that will convert a
column of text to values. For example, I have the following in column
A:

'100
'1000
'20

I want this to be converted to values like this:

100
1000
20

Thanks





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default text to values

As a matter of interest:
nor would your formula approach work since the single apostrophe is viewed
as a formatting character and would be ignored by the formula. So the
formula would remove the first digit on the left as well.

=VALUE(A1)
would work.


Sub Converttonumbers()
for each cell in selection.specialcells(xlconstants,xltextvalues)
if isnumeric(cell.value) then
cell.Formula = cdbl(cell.Value)
end if
Next
End Sub

--
Regards,
Tom Ogilvy


"Kevin Stecyk" wrote in message
...
Sorry, disregard my answer...not a macro.

Kevin


"Kevin Stecyk" wrote in message
...
Snax,

You could use a formula such as in cell B1

=RIGHT(A1,LEN(A1)-1) where A1 was your '100 value.

Just copy the formula down.

In essence, it says, take the right most characters, except the very

first
charcter (length - 1).

Hope that helps.

Regards,
Kevin





"snax500" wrote in message
om...
In Excel2000, what is the best way to code a macro that will convert a
column of text to values. For example, I have the following in column
A:

'100
'1000
'20

I want this to be converted to values like this:

100
1000
20

Thanks







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default text to values

in B1 try this:
=value(a1)

if you have blanks:
=if(a1="","",value(a1))

this is using a formula instead of code.

James


-----Original Message-----
In Excel2000, what is the best way to code a macro that

will convert a
column of text to values. For example, I have the

following in column
A:

'100
'1000
'20

I want this to be converted to values like this:

100
1000
20

Thanks
.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default text to values

Try:

Sub ConvertText()
Columns("A:A").TextToColumns Destination:=Range("A1")
End Sub

In om,
snax500 typed:
In Excel2000, what is the best way to code a macro that will convert a
column of text to values. For example, I have the following in column
A:

'100
'1000
'20

I want this to be converted to values like this:

100
1000
20

Thanks



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
Sumif using Values, but returning text or values Jose Excel Discussion (Misc queries) 1 April 14th 10 09:01 PM
Plotting XY with X text values? Credit ratings and their ROE values Victor Blaer Charts and Charting in Excel 0 August 14th 09 03:08 PM
How do I sum values in a row if the value in a row above = text Steve Excel Worksheet Functions 2 October 8th 06 02:42 AM
Text values to numeric values jayveejay Excel Discussion (Misc queries) 1 August 10th 05 05:03 PM
Text Values Brando Excel Discussion (Misc queries) 5 April 18th 05 03:09 AM


All times are GMT +1. The time now is 05:15 PM.

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"