Previously I have been told how to use the union command which was very helpful. Now I want to select a contiguous range in excel using row and column numbers as opposed to cell address’s so instead of select range “A1:A100” I would like to be able to use say select cell 1 of column 1 to cell 1 of column 100. Using union for 100 cells would be very cumbersome and I think I was told there is a limit with which was less than a 100.
Thanks
Start out with the first cell and then resize it to however many columns or rows you want.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "Microsoft Excel"
tell active workbook
tell active sheet
set firstCell to cell 1 of column 1
--range "$A$1"
set colRange to get resize firstCell column size 100
--returns range "$A$1:$CV$1"
set rowRange to get resize firstCell row size 100
--returns range "$A$1:$A$100"
set regionRange to get resize firstCell row size 100 column size 100
--returns range "$A$1:$CV$100"
end tell
end tell
end tell
FYI: Just to clarify, the union
(along with the similar intersect
) commands work with up to 32 ranges each, not 32 individual cells. A range can be 1 cell, or 100,000 cells or more.