Axel_Lerner
New member
- Joined
- Mar 22, 2015
- Messages
- 4
- Reaction score
- 0
- Points
- 0
I'm using MS Excel for Mac 2011.
I want to pick a contiguous group of cells in my Excel spreadsheet, then run a macro. Note that the number of rows picked could be highly variable, and the first row picked could be highly variable.
I want that macro to know which rows I've picked, and sort a DIFFERENT group of contiguous cells in the same exact rows as I picked before running the macro. And then sort again on yet another different group of contiguous cells in the same exact rows as I picked before running the macro. In both "sorts" I plan to hard code in the columns for sorting.
I don't understand Excel VBA "grammar" at all. I learned BASIC a long time ago, but VBA is different, and I forgot a lot of BASIC anyhow.
I've tried things for a couple days and gotten nowhere. I'm stuck on how to transfer the starting row and final row into VBA. The sorting code is not the problem, since I can just "Record Macro" and get the commands for that.
I have tried Range("D"&(ActiveCell.Row,1).Select
That gets me to the current row at least, but ActiveCell.RowHeight doesn't seem to get me to the last row. If Selection.Offset is the answer, I'm not doing it right.
(My first post. Assume I know none of the lingo! For instance: I tried googling for answers but I must be using the words "selection" and "range" incorrectly.)
Axel
I want to pick a contiguous group of cells in my Excel spreadsheet, then run a macro. Note that the number of rows picked could be highly variable, and the first row picked could be highly variable.
I want that macro to know which rows I've picked, and sort a DIFFERENT group of contiguous cells in the same exact rows as I picked before running the macro. And then sort again on yet another different group of contiguous cells in the same exact rows as I picked before running the macro. In both "sorts" I plan to hard code in the columns for sorting.
I don't understand Excel VBA "grammar" at all. I learned BASIC a long time ago, but VBA is different, and I forgot a lot of BASIC anyhow.
I've tried things for a couple days and gotten nowhere. I'm stuck on how to transfer the starting row and final row into VBA. The sorting code is not the problem, since I can just "Record Macro" and get the commands for that.
I have tried Range("D"&(ActiveCell.Row,1).Select
That gets me to the current row at least, but ActiveCell.RowHeight doesn't seem to get me to the last row. If Selection.Offset is the answer, I'm not doing it right.
(My first post. Assume I know none of the lingo! For instance: I tried googling for answers but I must be using the words "selection" and "range" incorrectly.)
Axel