Re: Replacing specific text within a table cell
- From: Steve Rindsberg <abuse@xxxxxxxxxxxxx>
- Date: Mon, 26 Feb 2007 14:51:19 EST
In article <7588A428-C8E7-4F9D-BC98-E9553F901749@xxxxxxxxxxxxx>, Barb Reinhardt
wrote:
It's with specifically identified cells and is not a global change. I've
actually determine how to do this, but the results are now strings and I need
them to be numeric. How can I resolve this?
Textranges contain strings, never numerics. I'm guessing you need to convert values
like "$500M" to something that you can convert to numerics?
Something like this, assuming you've got the value you want to work with in sTemp, a
string variable:
sTemp = Replace(sTemp,"M","")
sTemp = Replace(sTemp,"$","")
' and depending on whether you plan to use val(sTemp) or cdbl(sTemp) or
' something else to convert to numeric, you may also want to
' eliminate commas
sTemp = Replace(sTemp,",","")
Now Cdbl(sTemp) or Val(sTemp) gives you a numeric
Thanks,
Barb Reinhardt
"John Wilson" wrote:
Hi Barb
Is this "M" and" $" as discreet words or within other words. Surely
replacing all M's with "" would give some unexpected results?
--
Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk/ppttipshome.html
email john AT technologytrish.co.uk
"Barb Reinhardt" wrote:
I have identified a specific textrange that I want to replace text in, but am
not sure how to go about doing it. I want to change "M" to "" and "$" to ""
in that text range. Can someone assist?
Thanks,
Barb Reinhardt
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
.
- Prev by Date: Re: Put the cursor to the end of the text
- Next by Date: Re: Can i remove selected colors from Background Dialog Box?
- Previous by thread: Re: Using Notes feature for handouts
- Next by thread: Re: Can i remove selected colors from Background Dialog Box?
- Index(es):
Relevant Pages
|