Article View: comp.apps.spreadsheets
Article #222Re: Excel macro help! !pleh orcam lecxE
From: Jonathan Cave
Date: Tue, 10 Nov 1992 16:36
Date: Tue, 10 Nov 1992 16:36
33 lines
1463 bytes
1463 bytes
In article <udarryl.721045294@mcl> udarryl@mcl.ucsb.edu (Darryl 'Well) writes:
|
|ANYWAYS, right nowm, my macro looks like this:
|
|A1 flipit
|A2 =ARGUMENT("tex",2)
|A3 =FOR("count",1,LEN(tex),1)
|A4 =count
|A5 =(LEN(tex)+1)-count
|A6 =REPLACE(tex,count,1,MID(tex,(LEN(tex)+1)-count,1))
|A7 =NEXT()
|A8 =tex
|A9 =RETURN(A6)
||
|(cells a4, and a8, are strictly for debugging purposes, unless you can
|think of a better use for them)
There is certainly a better use for A8 -- it is a good place to keep
track of the current version of tex. The problem with the macro as written
is that the variable "tex" does not get updated.
Try the following
|A1 flipit
|A2 =ARGUMENT("tex",2)
|A3 =FOR("count",1,LEN(tex),1)
|A4 =if(count=1,tex,A6)
|A5 =(LEN(A4)+1)-count
|A6 =REPLACE(A4,count,1,MID(A4,(LEN(A4)+1)-count,1))
|A7 =NEXT()
|A8 =RETURN(A6)
Jonathan
Technical Details
Message-ID:
<13975@cis.rand.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!ogicse!emory!sol.ctr.columbia.edu!usc!randvax!cis.rand.org!caveReferences:
<udarryl.721045294@mcl>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!emory!sol.ctr.columbia.edu!usc!randvax!cis.rand.org!cave From: cave@cis.rand.org (Jonathan Cave) Newsgroups: comp.apps.spreadsheets Subject: Re: Excel macro help! !pleh orcam lecxE Keywords: macro flip excel help writing stupid Message-ID: <13975@cis.rand.org> Date: 10 Nov 92 16:36:25 GMT Article-I.D.: cis.13975 References: <udarryl.721045294@mcl> Sender: news@cis.rand.org Reply-To: cave@cis.rand.org (Jonathan Cave) Organization: RAND, Santa Monica CA Lines: 33