Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatic location and order of DataLabels? | Charts and Charting in Excel | |||
how to change font size of datalabels of two charts in a sheet | Charts and Charting in Excel | |||
Eliminate DataLabels upon eachother not readable? | Charts and Charting in Excel | |||
Lock the chart but leave datalabels position editable | Charts and Charting in Excel | |||
How to assign datalabels to a scatter chart, obtaining the labels. | Excel Discussion (Misc queries) |