• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determining
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining


  • Subject: Re: Determining
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 26 Nov 2007 20:12:35 -0800
  • Thread-topic: Determining

On 11/27/07 1:03 AM, "Stan Cleveland" <email@hidden> wrote:

> On 11/26/07 6:42 AM, Justin Laden wrote:
>
>> I'm attempting to return the row number of last cell with data in a
>> Excel table.  Is there a way to do this?
>
> Assuming Excel 2004, this should work (watch for text wrap):
>
> tell application "Microsoft Excel"
> set lastRow to first row index of (special cells range "A1:IV65535" type
> cell type last cell)
> end tell
>
> You can use a smaller range than "A1:IV65535" if you have some idea where
> the "last cell" is.

That's easy enough to determine:

    used range of active sheet

So:

tell application "Microsoft Excel"
    set lastRow to first row index of (special cells (used range of active
sheet) type cell type last cell)
end tell


--
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:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Determining (From: Stan Cleveland <email@hidden>)

  • Prev by Date: Re: Repeat until ...the user chooses to stop?
  • Next by Date: Re: Init Caps Handler
  • Previous by thread: Re: Determining
  • Next by thread: Determining
  • Index(es):
    • Date
    • Thread