Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to move a selected range to the next row?

Let's say I have "E9:H9" selected and want the selection to move to "E10:H10". Is there a shortcut for it? The selection should not be extended but moved one row down.

share|improve this question
    
I suppose you want to retain the data? –  Sathya Oct 4 '11 at 9:28
1  
Simple Cut & Paste will work for you, select your data, click "Ctrl+X", now click on cell address E10:H10 and press "Ctrl+V" , it's done... –  Random Guy Oct 4 '11 at 9:41
    
Hi. That's not what I had in mind. But I solved it using a macro. Thx anyway. –  user48604 Oct 4 '11 at 9:54
    
@user48604 please post the macro as an answer. –  Sathya Oct 4 '11 at 10:08
add comment

3 Answers

up vote 5 down vote accepted

It sounds like you just need something like this:

Sub moveselection()

Selection.Offset(1, 0).Select

End Sub

This will move your selection one row down without changing the size of the selection.

share|improve this answer
add comment

(a) That code doesn't move down one row as per question

(b) It will work on only the first row of a selection, did you want it to work on a multiple row selection ?

(c) Rather than call a sub for this you could run it automatically by right clicking your mouse - you can do this by adding right clicking your sheet tab, View Code, and pasting in the code below

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    On Error Resume Next
    Range("E" & CStr(Selection.Row) & ":" & "GN" & CStr(Selection.Row)).Select
End Sub
share|improve this answer
add comment

Ok,

The cursor has to be in the row and the ranges "E" and "GN" need adjustement for different columns but it saves me some time:

Sub SelectRange()

  Dim RowNumber As Integer

  RowNumber = Selection.Row
  Range("E" & CStr(RowNumber) & ":" & "GN" & CStr(RowNumber)).Select

End Sub
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.