If I select two ranges of a worksheet from within the worksheet/Excel itself and run a VBA (macro) to perform operations in VBA on the ranges, how do I identify those two selections in the VBA code to work with them?
In other words, in the work book drag with the mouse to select a range, then Ctrl+drag a second range then call/run the macro/VBA. (For example, right-click drag cells B11 to B14, release, then Ctrl-right-click cell F1 (or F1 to F7). Then run the macro.)
How do I reference those two selected ranges (B11:B14 and F1 or F1:F7from the example) in the VBA code?
I see many example within VBA of selecting multiple ranges, but how do I refer to ones "passed" to the macro? (I'm thinking it would be something like Application.Selection.first and Application.Selection.second, etc but VB doesn't show anything to choose past Application.Selection .)
Is it even possible to identify that two selections exist or is it all one selection, even if they are disjoint ranges?
If it's all one selection (Application.Selection), how might I identify two non-contiguous ranges from within the selection and "split" them into two?
I just found out that in Excel I can select three non-adjacent cells from any row or column, but I can only copy those three cells if they are on the same row or column. I didn't try more cells.
This is all in Excel 2007.