Re: Excel 2004 Scripting Block
Re: Excel 2004 Scripting Block
- Subject: Re: Excel 2004 Scripting Block
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 28 Oct 2004 12:01:03 -0700
Title: Re: Excel 2004 Scripting Block
On 10/28/04 11:29 AM, "Paul Berkowitz" <email@hidden> wrote:
OK. Now, looking for the first cell of the used range whose value is "6001-014" crashes Excel here. This is a serious bug - I'll report it. 'whose' clauses don't seem to work on value of cells, without crashing.
But it doesn't matter, since there's a much faster way even than whose clauses, using Excel's own 'find' command. That's in the Table Suite, for some reason (I guess because it deals with ranges), It's really simple, and really fast:
tell application "Microsoft Excel"
set ur to used range of active sheet
set f to find ur what "6001-014"
set c to get address f
end tell
--> "$D$3"
There are lots and lots of optional parameters for 'find' - check the dictionary. You can search just after a particular sub-range, specify which direction to start searching, whether case-sensitive or not, etc. etc. It's really great.
Also 'get address' has optional parameters too. If you don't want the absolute address reason for any reason, you can specify
tell application "Microsoft Excel"
set f to find used range of active sheet what "6001-014"
set c to get address f without row absolute and column absolute
end tell
--> "D3"
or even R1C1 style:
tell application "Microsoft Excel"
set f to find used range of active sheet what "6001-014"
set c to get address f reference style R1C1
end tell
--> "R3C4"
--
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