Re: Excel: newby question (bis)
Re: Excel: newby question (bis)
- Subject: Re: Excel: newby question (bis)
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 06 May 2002 01:15:38 -0700
On 5/6/02 12:36 AM, "Olivier Berquin" <email@hidden> wrote:
>
Hi all,
>
>
Sorry for my bad english... I re-explain mu 'problem'.
>
>
I would like to have the last "record" of an excel sheet, like in FileMaker:
>
>
--
>
tell application "FileMaker Pro"
>
set myRecordCount to the count of records of database 1
>
end tell
>
--
>
Result: "2251"
>
>
I have this:
>
--
>
set TheLastOnt to SpecialCells (UsedRange of ActiveSheet) Type xlLastCell
>
--
>
>
But, I haven't, in the result, something like "2251"
>
>
Result:
>
Range "R2251C4" of Worksheet "CATABENECLASMAY" of Workbook "Classic.xls"
>
>
Do I works with this string to have the last row ?
Well, you said you wanted the range of the last cell. You didn't say you
wanted the last row number. Which do you actually want?
tell application "Microsoft Excel"
set ur to UsedRange of ActiveSheet
set rr to (count Rows of ur) -- last row number
end tell
(If, unusually, the used range doesn't begin with the first row - if there
are any blank rows at the top, that is - you can find out which row is the
first of the used range, then add that, less 1, to rr:
set r to Row of ur
set lastRowNum to (r - 1 + rr)
)
--
Paul Berkowitz
_______________________________________________
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.