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

Re: Scripting Excel X


  • Subject: Re: Scripting Excel X
  • From: David Wignall <email@hidden>
  • Date: Thu, 09 May 2002 22:23:59 +1200

on 9/5/02 3:43 am, Eric Phillips at email@hidden wrote:

<snip good stuff from Mr Berkowitz>

> When changing this VB macro to AS I am having problems checking the value of a
> cell. In VB the statement looks like:
>
> if Cell.Value (rowcounter,3) = "" then

That should be

If Cells(rowcounter, 3).Value = "" Then...

> I assumed since Cell.select (rowcounter,3) in VB changes to
>
> Select cell "R1C3"
>
> in AS the
>
> Value cell "R1C3" should work but it doesn't.

And that should be

Value of Cell "R1C1"

Or

Cell "R1C1"'s Value

Both work.

> I feel dirty saying this but being able to use (1,1)
> format in VB is cleaner than having to use "R1C1" format in AS.

VBA uses R1C1 as well, just not as a string.

> I remember in Excel 4 Macro Language I could refer to a
> cell as y rows down and x columns over from the active cell. Can I do this in
> AS,

Yes, it's the "offset" that you're looking for. Same as VBA.

> it would mean when I cut the contents from one cell I could just use a
> referance to the cell I want to paste the information into with out having to
> go through the whole set cellref statement.

This works in Office 2001

tell Application "Microsoft Excel"
repeat with rowcounter from 1 to 10
set cellref to Range ("R" & rowcounter & "C3")
if Value of cellref = "Meats" then
Cut cellref To Offset of cellref RowOffset 2 ColumnOffset -2
end if
end repeat
end tell

--
hth
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 Excel X (From: "Eric Phillips" <email@hidden>)

  • Prev by Date: Re: OS X replacement for Script Scheduler
  • Next by Date: Text Manipulation
  • Previous by thread: Re: Scripting Excel X
  • Next by thread: Re: Scripting Excel X
  • Index(es):
    • Date
    • Thread