But after selecting a lenghty range, usually with mouse, I shift to the LAST
cell with SHIFT+TAB, or even CTRL+"." twice. Whereas your code only moves
step by step.
Would you kindly recommend me a piece of code for moving to the last cell
selected in the range?
<<Would you kindly recommend me a piece of code for moving to the last cell
selected in the range?>>
To move to the last cell in a selection, regardless of whether it has data
in it or not, try the following:
'----------------------------------------------------------------------
Public Sub ActivateLastCellInSelection()
Dim rngSelection As Range
Dim rngLastCell As Range
On Error GoTo ExitSub
Set rngSelection = Selection
With rngSelection
Set rngLastCell = .Resize(1, 1) _
.Offset(.Rows.Count - 1, _
.Columns.Count - 1)
rngLastCell.Activate
End With
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.