Re: Scripting in Excel -> search different words in column and color them
Re: Scripting in Excel -> search different words in column and color them
- Subject: Re: Scripting in Excel -> search different words in column and color them
- From: Kai Edwards <email@hidden>
- Date: Mon, 28 Oct 2002 00:05:00 +0000
on Sun, 27 Oct 2002 08:15:17 -0800, Paul Berkowitz <email@hidden>
wrote:
>
On 10/27/02 7:18 AM, "Kai Edwards" <email@hidden> wrote:
>
<snip>
>
>
> So it was only when there were no cells (or a negligible number of them) to
>
> be found, that this approach lagged a little behind 'find-in-Excel'. (And
>
> since fewer found cells mean shorter delays generally, I'm not too unhappy
>
> about that.)
>
>
I think you might be able to make it even quicker by first coercing the
>
entire list of lists to string (use tab as delimiter), checking to see if
>
the resulting string contains any of the values you are seeking. if it
>
doesn't, end of script. if it does, check each rowVal: if the row doesn't
>
contain any of your search values, move on without checking colItems. If a
>
rowVal _does_ contain one of the search values, only then do it item by
>
item. At least for the "no cells" scenario, this should be much faster; I'm
>
not sure about the row-by-row checking, but it's worth a try. You could keep
>
just the valString check if the rowVal check doesn't help.
Thanks for that insight, Paul.
As it happens, I did try the row-by-row check and didn't gain the sort of
improvements I might have expected. (It seemed to add a slight overhead in
most cases). My guess is that if more columns had been involved, the story
might have been quite different. I shall revisit this one as soon as I have
another spare moment!
I think the initial check is a very sound idea - well worth incorporating.
While we're on the subject, do you have any experience of the string limit I
referred to? Although the problems appeared to be coming from Excel, I did
wonder (considering that they seemed to surface as soon as the 255 character
threshold was crossed) whether AS might conceivably be the culprit. I tried
returning the strings and checking the results window, etc., but could find
nothing to suggest a possible cause.
Thanks again for taking the time to look at the script so constructively -
and for providing yet more food for thought! :-)
Best wishes.
Kai
--
email@hidden
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.