Re: Scripting Excel to go to the next row
Re: Scripting Excel to go to the next row
- Subject: Re: Scripting Excel to go to the next row
- From: Kai Edwards <email@hidden>
- Date: Thu, 24 Oct 2002 10:16:14 +0000
on Wed, 23 Oct 2002 21:13:09 -0400, Craig Treleaven <email@hidden>
wrote:
>
And you don't have to select, then paste. Just set the values directly,
>
ala...
>
>
tell application "Microsoft Excel"
>
set myVar to "BlahBlahBlah"
>
set myCell to (ActiveCell Offset RowOffset 1)
>
set Value of myCell to myVar
>
set Value of Range "R2C2" to myVar
>
end tell
Unless 'ActiveCell' just happens to be cell B1, I'm afraid that would set
two cells to whatever is in the variable 'myVar'.
Discarding the select command is also moving away from the OP's aims, which
were:
>
1. paste a time-code (generated by a script in QT Player) into a cell
>
2. select the cell below this ready to begin the process (ie pasting) again
As you say though, there's no real need to paste:
------------------------------------------------------------------
-- do stuff in QT Player, including setting the variable 'timeCode'
tell application "Microsoft Excel" to set {ActiveCell's Value, [NO BREAK]
ActiveCell} to {timeCode, ActiveCell Offset RowOffset 1}
------------------------------------------------------------------
If required, you could also avoid moving the selection altogether by
updating a variable containing a reference to the most recently modified
cell. However, the above is probably the simpler approach.
Kai
--
email@hidden
email@hidden
_______________________________________________
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.