Created
June 9, 2017 06:00
-
-
Save metzenseifner/66f9ef2beb65ad3e44a5a7deea3d4aaf to your computer and use it in GitHub Desktop.
Excel Row Sequence Column by Column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Microsoft Excel" | |
set screen updating to false -- optimize performance | |
set range_selected to selection | |
-- setup ref vars for selection | |
tell selection to set {range_selected_row_index, range_selected_column_index, range_selected_row_count, range_selected_column_count} to {get first row index of selection, get first column index of selection, get count rows of selection, get count columns of selection} | |
-- go row by row and iterate each column in each row | |
repeat with row_step from range_row_index to range_row_count -- row iteration | |
repeat with column_step from range_column_index to range_column_count -- column iteration | |
set range_this_cell to range (get address row row_step of column col_step of active sheet) of active sheet | |
log range_selected | |
end repeat | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment