Last active
June 9, 2017 06:00
-
-
Save metzenseifner/ee2dffa836d2dda3062b56e9c00f1bb0 to your computer and use it in GitHub Desktop.
Excel Selection Column Sequence Row by Row
This file contains hidden or 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 column by column and iterate each row in each column | |
| repeat with column_step from range_column_index to range_column_count -- column iteration | |
| repeat with row_step from range_row_index to range_row_count -- row 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