S
Selsted
(I refer to C# code, but answers in VB are welcome)
I have a Range in Excel, which includes several cells (the cells the user
selected in the Excel sheet). The range might include the following cells A2,
B7, G4. This means that the cells might not be connected.
If I look at myRange.Cells.Count, it will return 3. If I look at
myRange.Row, it will return 2 (if A2 was the first selected row by the user).
Now, I need to get the row numbers of all selected rows, so in the above
range, I need an int[] of {2, 7, 4}. But I can't see any solution to go
through the Cells and get the row index for the individual cell.
I have a Range in Excel, which includes several cells (the cells the user
selected in the Excel sheet). The range might include the following cells A2,
B7, G4. This means that the cells might not be connected.
If I look at myRange.Cells.Count, it will return 3. If I look at
myRange.Row, it will return 2 (if A2 was the first selected row by the user).
Now, I need to get the row numbers of all selected rows, so in the above
range, I need an int[] of {2, 7, 4}. But I can't see any solution to go
through the Cells and get the row index for the individual cell.