• 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: Excel Selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excel Selection


  • Subject: Re: Excel Selection
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 30 Oct 2006 13:09:40 -0800
  • Thread-topic: Excel Selection

On 10/30/06 12:39 PM, "Steven Valenti" <email@hidden> wrote:

> I want to get the row and column of selected cell or cells. If I use
> this code...
> set MySelection to selection
> ...I get
> --selection of Application "Microsoft Excel" as a result
> Dictionary states the selection returns a Range but I was expecting
> something like "A3" or whatever was selected.
> Is there anyway to return the row and column value of a selection?

Yes, look up 'range' in the dictionary, and also read the introductory
section of the Excel AppleScript Reference (free download from
www.microsoft.com/mac/ , go to Resources/Developers/AppleScript) which is
all about working with ranges.

Most objects are (as is frequent with AppleScript) passed as references
rather than being evaluated. That has its advantages: if you want to modify
the selection, you can. It is a little annoying sometimes that it doesn't
evaluate to the range-by-address (i.e. range "A10:A15" of worksheet "Name"
of workbook "File Name.xls"), but you can manipulate it exactly as if it
did.

Try

    properties of selection

and you'll see you get all of them. You can pick and choose whichever
property you want to return. Or you can apply a command to it. (In this case
you don't even have to get it as a variable first nor use the explicit
'get'):

    get address selection
    --> "$A$10:$A$15"

('get address' is an Excel command - it's not the explicit 'get' there
either.)

--
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/mailman//archives/applescript-users

This email sent to email@hidden

References: 
 >Excel Selection (From: Steven Valenti <email@hidden>)

  • Prev by Date: Re: Re: Strange character changes
  • Next by Date: Re: Strange character changes
  • Previous by thread: Excel Selection
  • Next by thread: Re: Excel Selection
  • Index(es):
    • Date
    • Thread