View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bill Renaud Bill Renaud is offline
external usenet poster
 
Posts: 417
Default MOVING WITH A RANGE-TAB

<<...your code only moves step by step.

That's what TAB does.

<<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

ExitSub:
End Sub


--
Regards,
Bill Renaud