Re: Lots of Excel text
Re: Lots of Excel text
- Subject: Re: Lots of Excel text
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 18 Jul 2005 14:11:01 -0700
- Thread-topic: Lots of Excel text
On 7/18/05 1:50 PM, "Hanaan Rosenthal" <email@hidden> wrote:
> I have a problem with Excel that requires me to take a whole bunch of text
> from an Excel cells and do the following:
> 1. Combine two or more cells (each has 30000 characters, other than the last
> one that has less).
> 2. Search and replace text in the combined string.
> 3. Split the text back to 30000 character blocks.
> 4. Place each block back in cells A1, B1, C1...
>
> I can't use copy/paste of set value since these are limited in size.
> Any suggestions?
> I tried a bunch of export/import tests and got close...
> I can export the worksheet as text, combine it, search and replace and re-
> save to text.
> Placing the long chunks of text in Excel is the big issue.
Excel has its own really powerful 'find' and 'replace' commands (Text
Suite). I suggest you use that instead - it's super-fast. (And _much_
simpler than in Word.)
set theResult to replace (used range of active sheet) what searchString
replacement replacementString
with lots of optional parameters for range of cells, case, diacritics,
control characters, even the way to do the search.
Again, the Excel AppleScript Reference will explain any things you're not
sure of, but the dictionary is pretty clear.
Pretty well anything - make that anything - you can do in the Excel UI can
be done by AppleScript, and it will be much faster than extracting strings
to do AppleScript manipulations on and then put back. I had a lot of fun
converting my Excel X scripts (which could already do a lot of this,
including Replace) to 2004 versions which can do it all.
It's really worth your while looking for these ways in the dictionary,
Hanaan, before starting out using the tedious approaches that you'd need in
most other apps (or no app). Excel is made for calculations and
substitutions - sometimes just doing an Excel Formula by script is faster
and easier even than using the AppleScript terms. The Help is pretty good
for those.
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden