I have a fairly large spreadsheet to list customer details which is sorted by sales reps (about 40 reps). I want to be able to double click on a rep's name (in Column C) and have VBA automatically group the rows below it that have the same data in column C as what was in the cell that i double clicked in) with his name; then double click on the next rep and group, etc. The reps' names are always in column C.
For example, if i doubleclick in cell C4, it will "memorize" that row (4) and the contents of the cell C4 and look in row 5. If C5 contains the same value as C4, it will look in row 6. if cell C6 has the same value as C4, it will look in row 7. It will do this until it doesn't find a match - let's say C50 is different. it will then GROUP the rows C4 (starting row) to C48 (C49 is last match and it would have to go up one row to 48 so that row 49 would be visible when the group is collapsed).
Any advise/guidance would be appreciated.
For example, if i doubleclick in cell C4, it will "memorize" that row (4) and the contents of the cell C4 and look in row 5. If C5 contains the same value as C4, it will look in row 6. if cell C6 has the same value as C4, it will look in row 7. It will do this until it doesn't find a match - let's say C50 is different. it will then GROUP the rows C4 (starting row) to C48 (C49 is last match and it would have to go up one row to 48 so that row 49 would be visible when the group is collapsed).
Any advise/guidance would be appreciated.