• 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: Copy range and paste values in Excel — grammar issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Copy range and paste values in Excel — grammar issues
      • From: Alastair Leith <email@hidden>
    • Re: Copy range and paste values in Excel — grammar issues
      • From: Alastair Leith <email@hidden>
References: 
 >Copy range and paste values in Excel — grammar issues (From: Alastair Leith <email@hidden>)

  • Prev by Date: Copy range and paste values in Excel — grammar issues
  • Next by Date: Re: Copy range and paste values in Excel — grammar issues
  • Previous by thread: Copy range and paste values in Excel — grammar issues
  • Next by thread: Re: Copy range and paste values in Excel — grammar issues
  • Index(es):
    • Date
    • Thread