You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Looking for a good sample of an apple script that copies a range of cell and writes it to another in different, within the same document work book

I have a working script that copies a range of a column to another column within the same table, now I would like to copy to another table in a different sheet. Basically read from sheet1 table1 and write to sheet 2 table two.


*if by chance, I would like it to omit the blanks within the range.


here is the original working script, please feel free to modify or change it entirely to something better

as long as it able to to do the task, I am open to ideas or solutions.


here is the generic script


set tblName to "Table 1"
set srceRng to "H2:H16"
set destRng to "A2:A16"

tell application "Numbers"
	tell document 1 to tell active sheet
		tell table tblName
			set destCol to range destRng's column 1's address
			repeat with c in range srceRng's cells
				set v to c's value
				set r to c's row's address
				set row r's cell destCol's value to v
			end repeat
		end tell
	end tell
end tell


  1. Copy a range in table 1 sheet 1 to sheet 2 with same workbook/doc
  2. while eliminating blanks
  3. create sheet 2 with same dimensions if sheet 2 doesn't exist (extra not necessary) I will be happy with the first two

THANKS

MacBook Air, macOS 14.0

Posted on Oct 21, 2023 6:45 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 21, 2023 5:13 PM

sure did, much appreciated.

Similar questions

2 replies

Looking for a good sample of an apple script that copies a range of cell and writes it to another in different, within the same document work book

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.