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

Re: Scripting in Excel


  • Subject: Re: Scripting in Excel
  • From: David Wignall <email@hidden>
  • Date: Mon, 28 Oct 2002 21:44:14 +1300

on 25/10/2002 4:52 AM, Paul Berkowitz at email@hidden wrote:

> On 10/24/02 2:36 AM, "David Wignall" <email@hidden> wrote:
>
>>
>> Just vaguely apropos to this, does AppleScript have a For Each object In
>> collection type of statement? The ASLG doesn't reveal anything to me.
>
> ASLG, pp. 256-7, but notice the catch described in the NOTES, requiring
> 'contents of' operator, or else evaluating the list item explicitly to a
> variable. For that reason (i.e. forgetting about it), it's usually simpler
> to use the 'Repeat With (loopVariable) From (startValue) To (stopValue)'
> method.

(been away, hence the pause)

Thanks for that Paul. After a bit of play, and listening to you and has, I'm
not sure that this is quite what I was looking for. In VBA you can say

For Each rangevariable In targetrange.Cells
(a whole lot of dot syntax stuff)
Next rangevariable

which makes life very easy. If I try various versions of

set theTargetRange to Range ("A1:A5")
repeat with theCell in (Cells of theTargetRange)
end repeat

then I get error messages about various things not understanding the Count
message. OTH

repeat with i from 1 to count of (Cells in theTargetRange)
set theCell to item i of theTargetRange
end repeat

tells me that it can't get item 1 of Range(etc). This is on Office X, BTW.

So, am I missing something or is this an XL implementation issue or is this
a usage that AppleScript lacks?

--
Dave
_______________________________________________
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.

References: 
 >Re: Scripting in Excel -> search different words in column and color them (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: illustrator-10-scripting: removing things
  • Next by Date: David Johnson/SUT/HHShoppers is out of the office.
  • Previous by thread: Re: Scripting in Excel -> search different words in column and color them
  • Next by thread: Re: Scripting in Excel -> search different words in column and color them
  • Index(es):
    • Date
    • Thread