Re: excel rows
Re: excel rows
- Subject: Re: excel rows
- From: Stan Cleveland <email@hidden>
- Date: Wed, 27 Aug 2014 15:22:23 -0700
On Aug 27, 2014, at 2:41 PM, RJay Hansen wrote:
> Trying to get some cells from an excel file and put them into an InDesign document. After I get the text from my first cell inserted into InDesign I need to skip down 1000 rows to get my next cell. Apparently I can't just take the current row number and add 1000 to it since the row number isn't actually a number. Can Excel row numbers be coerced into numbers? If so, how? If not, how would you find the next row?
Hi RJay,
The following code is basic, but maybe it will get you pointed in the right direction.
Stan C.
set rowsToGet to {2, 102, 1002}
repeat with rw in rowsToGet
tell application "Microsoft Excel"
------- get one cell at a time
set cellContents to formula of cell ("B" & rw) -- raw data
--> "=SUM(C2:H2)/6"
set cellContents to value of cell ("B" & rw) -- unformatted value
--> 12.333333333333
set cellContents to string value of cell ("B" & rw) -- formatted value
--> "12.33"
------- get a range within one row
set rangeContents to formula of range ("A" & rw & ":H" & rw) -- raw data
--> {{"Average", "=SUM(C2:H2)/6", "10", "13", "13", "14", "12", "12"}}
set rangeContents to value of range ("A" & rw & ":H" & rw) -- unformatted value
--> {{"Average", 12.333333333333, 10.0, 13.0, 13.0, 14.0, 12.0, 12.0}}
set rangeContents to string value of range ("A" & rw & ":H" & rw) -- formatted value
--> {{"Average", "12.33", "10", "13", "13", "14", "12", "12"}}
end tell
end repeat
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden
References: | |
| >excel rows (From: RJay Hansen <email@hidden>) |