Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving range? wx4usa Excel Discussion (Misc queries) 7 December 26th 09 04:28 PM
sum with moving range snax500 Excel Discussion (Misc queries) 3 July 10th 06 05:56 AM
Moving to next row below a selected range Loris Excel Programming 6 December 5th 05 03:47 AM
formula with moving range sctroy Excel Discussion (Misc queries) 2 November 11th 05 03:20 AM
VB: moving data range Greg Excel Programming 0 September 20th 05 02:39 PM


All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"