PDA

View Full Version : how to select Last cell in Multiple Selections



Nick_London
03-04-2011, 09:29 AM
Hi,

Really stuck with this and need some help.

Running the following line of code while a selecting a range of cells takes it to the last cell in the selection. This works fine a a single selection of cells, eg. a1:c20, the code would take you to a20 of the range:

Selection.Cells(Selection.Rows.Count, 1).Select

However, when I have mutiple selected ranges, this does not work, it always selects the cell in the first selection, not the last. E.g If I have a1:c20, a24:c30 selected, it will go to A20, but I want to go to the last cell of the last selected range, i.e a30.

Does anyone know how to do this?

Many thanks,

Nick

Bob Phillips
03-04-2011, 09:44 AM
With Selection

.Areas(.Areas.Count).Cells(.Areas(.Areas.Count).Rows.Count, 1).Select
End With