我想转置表格(将行与列互换,反之亦然)。如何在 iWork Numbers 中执行此操作。
答案1
我编写了一个简单的 AppleScript 来实现这个功能。
tell application "Numbers"
activate
tell the front document
tell the first sheet
set original_range to selection range of first table
set orignal_table to first table
set number_of_columns to column count of orignal_table
set number_of_rows to row count of orignal_table
set trasposed_table to make new table with properties {row count:number_of_columns, column count:number_of_rows}
repeat with i from 1 to number_of_columns
repeat with j from 1 to number_of_rows
tell orignal_table
set original_value to the value of cell i of row j
end tell
tell trasposed_table
set the value of cell j of row i to original_value
end tell
end repeat
end repeat
end tell
end tell
end tell
这里您可以找到有关它的更多详细信息。
答案2
使用最新版本 Numbers 的用户可以使用“表格”菜单下的“转置行和列”选项,如图所示StackExchange 上的这个答案。下面的图片也厚颜无耻地从那个答案中‘借用’了,以方便参考。