Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Converting DataLabels to Numbers

Hello.

I am trying to extract numbers from a Datalabel. Unfortunately, besides the
fact I am having trouble using the CInt or CDbl codes to do this, the label
contains both text and numbers. (Perhaps a Right code would help?)

Anyway, for example, the label will be "KHJ-LMNO 15%." I need to convert
this 15% to a numeric value to use in a loop in another procedure. The other
problem is sometimes it could be a single digit value, such as 3% or
possibly a three digit value, such as 100%. The extraction and conversion
would have to work for all scenarios.

Any help would be grealy appreciated.

Thanks.

Dan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Converting DataLabels to Numbers

If it is always preceded by a space and ends with a % sign:

i = instr(ALabel, " ") + 1
j = instr(i, ALabel, "%")
x = CDbl(Mid$(ALabel,i, j - i))/100


On Fri, 01 Aug 2003 02:54:34 GMT, "Dan Gesshel" wrote:

Hello.

I am trying to extract numbers from a Datalabel. Unfortunately, besides the
fact I am having trouble using the CInt or CDbl codes to do this, the label
contains both text and numbers. (Perhaps a Right code would help?)

Anyway, for example, the label will be "KHJ-LMNO 15%." I need to convert
this 15% to a numeric value to use in a loop in another procedure. The other
problem is sometimes it could be a single digit value, such as 3% or
possibly a three digit value, such as 100%. The extraction and conversion
would have to work for all scenarios.

Any help would be grealy appreciated.

Thanks.

Dan


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
Automatic location and order of DataLabels? tskogstrom Charts and Charting in Excel 1 November 11th 06 08:53 PM
how to change font size of datalabels of two charts in a sheet amrezzat Charts and Charting in Excel 1 May 9th 06 01:04 AM
Eliminate DataLabels upon eachother not readable? Marie J-son Charts and Charting in Excel 0 March 1st 06 05:37 AM
Lock the chart but leave datalabels position editable Joy Charts and Charting in Excel 1 June 13th 05 08:21 PM
How to assign datalabels to a scatter chart, obtaining the labels. Jos Koot Excel Discussion (Misc queries) 1 April 22nd 05 12:11 PM


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