Re: Copy range and paste values in Excel — grammar issues
Re: Copy range and paste values in Excel — grammar issues
- Subject: Re: Copy range and paste values in Excel — grammar issues
- From: Axel Luttgens <email@hidden>
- Date: Sat, 15 Mar 2014 00:48:49 +0100
Le 14 mars 2014 à 05:41, Alastair Leith a écrit :
> [...]
>
> I wish to iterate thru the emails placing the text to the previously mention range and then copying the values (not formulas) of the results in row 52 into to successive rows down the sheet from Row 54 onwards.
>
> [...]
Hello Alastair,
If you allow, let's consider a simplified example:
cell A1: input 1
cell A2: input 2
cell A3: formula "=A1&"|"&A2"
cell A4: placeholder for result 1
cell A5: placeholder for result 2
...
cell A13: placeholder for result 10
There are probably many ways to achieve this with AppleScript and Excel.
Here follows one way, probably not the most efficient, but rather legible (well, I hope).
HTH,
Axel
repeat with i from 1 to 10
set cellText to {{"row1_" & i}, {"row2_" & i}}
excel_set_input(cellText)
set r to excel_fetch_result()
log excel_store_value(i, r)
end repeat
on excel_set_input(L)
tell application "Microsoft Excel"
tell front sheet
set value of range "A1:A2" to L
end tell
end tell
end excel_set_input
on excel_fetch_result()
tell application "Microsoft Excel"
tell front sheet
value of cell "A3"
end tell
end tell
end excel_get_result
on excel_store_value(i, r)
tell application "Microsoft Excel"
tell front sheet
set value of cell ("A" & (i + 3)) to r
end tell
end tell
end excel_store_result
_______________________________________________
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