PC Review


Reply
Thread Tools Rate Thread

Applescript: get range of selection

 
 
Richard8A
Guest
Posts: n/a
 
      26th Sep 2008
Hopefully someone can help me, because if not I will not be able to migrate
my current collection of Applescripts to work with either Excel 2004 or Excel
2008 (I've been using Excel X because it still works).

So, this seems so simple that it should be obvious, but it's not. I've tried
just about everything, and my colleagues and I cannot come to a solution. I
want to get the range (preferably in "A1" format) of the currently selected
cell. That's it. Whether it's a range object or text, it doesn't matter. I
need to have the range itself to be able to pass to other functions and use
elsewhere after it is asked for. I can't simply always refer to the
selection. In fact, many of my scripts work much faster when I don't always
select the cell I want to work with. Here's the code snippet:

tell application "Microsoft Excel"
set rangeA1 to range of selection
return rangeA1
end tell

I always end up with a "missing value". I realize it is possible to get the
row and column, but many of Excel's commands after Excel X don't like R1C1
format for ranges.

Any help is appreciated. Thanks!
-Richard
 
Reply With Quote
 
 
 
 
NoodNutt
Guest
Posts: n/a
 
      26th Sep 2008
G'day Richard

Just finished night shift, so this may appear to be a dumb question...!

Does the Workbook you are attempting to access have more than 1 sheet, if
so, you need to specify the sheet name as the pointer for excel to go to..

Try this link:

Copy a range from closed workbook (Local, Network and on the internet)

http://www.rondebruin.nl/copy7.htm

If this doesn't help, goto Ron's main page

http://www.rondebruin.nl/tips.htm

You may find something that could point you in the right direction.

HTH
MArk.


 
Reply With Quote
 
Mike Middleton
Guest
Posts: n/a
 
      27th Sep 2008
Richard8A -

If you don't get assistance in microsoft.public.excel.programming, I suggest
you post in the very active microsoft.public.mac.office.excel newsgroup.

- Mike Middleton
http://www.DecisionToolworks.com
Decision Analysis Add-ins for Excel



"Richard8A" <(E-Mail Removed)> wrote in message
news:5BBCB8A1-9681-474E-836C-(E-Mail Removed)...
> Hopefully someone can help me, because if not I will not be able to
> migrate
> my current collection of Applescripts to work with either Excel 2004 or
> Excel
> 2008 (I've been using Excel X because it still works).
>
> So, this seems so simple that it should be obvious, but it's not. I've
> tried
> just about everything, and my colleagues and I cannot come to a solution.
> I
> want to get the range (preferably in "A1" format) of the currently
> selected
> cell. That's it. Whether it's a range object or text, it doesn't matter. I
> need to have the range itself to be able to pass to other functions and
> use
> elsewhere after it is asked for. I can't simply always refer to the
> selection. In fact, many of my scripts work much faster when I don't
> always
> select the cell I want to work with. Here's the code snippet:
>
> tell application "Microsoft Excel"
> set rangeA1 to range of selection
> return rangeA1
> end tell
>
> I always end up with a "missing value". I realize it is possible to get
> the
> row and column, but many of Excel's commands after Excel X don't like R1C1
> format for ranges.
>
> Any help is appreciated. Thanks!
> -Richard



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change InputBox Range Selection to Column Letter Selection intoit Microsoft Excel Programming 2 21st Jul 2009 07:58 AM
Applescript: get range of selection Richard8A Microsoft Excel Misc 0 26th Sep 2008 01:59 AM
Range(Selection, Selection.End(xlToRight)).Select =?Utf-8?B?RGF2ZSBCaXJsZXk=?= Microsoft Excel Programming 2 6th Jun 2007 04:53 PM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Microsoft Excel Programming 3 7th Jun 2004 09:13 PM
Applescript Problem Alex Sossick Microsoft Excel Programming 0 6th Jan 2004 05:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:40 AM.