Key Command to Move Range Selection

the_grimace

New Member
Joined
Sep 19, 2017
Messages
5
I'm sorry if this has been answered before. I've googled this question up and down and can't find an answer.

Is there a way to move your range selection to other parts of the worksheet? When you select just one cell, you can use the arrow keys to move that selection left, right, up, and down. I would like to do this when selection is more than one cell.

For example, lets say I select cells A1 through A10. Now I want to use a key command to move my selection to D1 through D10, or maybe move it downwards to A11 through A20. Or if I moved it to D1 through D10, now I want to move it back to B1 through B10.

Is there a keyboard command that will do this? Would love to be able to do this as I would use it very often. Thanks in advance!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
There is a way to do part of what you want using the shift key in conjunction with the arrow keys.

Select "A1" then hold down shift key while pressing arrow keys.
I do not know how a script could do what you want. The script would have to always know what you want to do and would have to be programmed into the script.
 
Upvote 0
From everything I read, there's doesn't seem to be a solution and even custom scripts have trouble working. I can't use shift because that just expands or decreases the selection. I want to move the selection. (Almost like when you click and drag a selection to a different part of an excel worksheet) If I have a 2x2 cell selection, I would like to move that around the worksheet at will.

I do think there is a way to do what I want using Shift in combination with tab, but I've done that and it's fairly cumbersome.
 
Upvote 0
Here is a kludge that you might find usable... it involves putting code in two different modules (a general module where macros are installed and the ThisWorkbook module where workbook-wide event code is installed).

Code for the general module
--------------------------------------------------------
Code:
[table="width: 500"]
[tr]
	[td]Public SelectionAddress As String, SelectionSizeOn As Boolean

Sub MoveSelection()
  SelectionSizeOn = True
  SelectionAddress = Selection.Address(0, 0)
End Sub[/td]
[/tr]
[/table]

Code for the ThisWorkbook module
--------------------------------------------------------
Code:
[table="width: 500"]
[tr]
	[td]Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
  If SelectionSizeOn Then Target.Resize(Range(SelectionAddress).Rows.Count, Range(SelectionAddress).Columns.Count).Select
  SelectionSizeOn = False
End Sub[/td]
[/tr]
[/table]

The general module can be brought up by clicking Insert/Module on the VB editor's menu bar... the ThisWorkbook module can be brought up by double clicking the ThisWorkbook item in the Project-VBAProject sub-window that is part of the VB editor.

I would suggest giving the MoveSelection macro a keyboard shortcut so you can more easily call it up. Once you have done that, make a selection (single contiguous range only), press the MoveSelection macro's shortcut key to activate it, then click on any cell on any worksheet and the selection will be moved to that location (upper left corner of the selection will be anchored at the cell you click on).
 
Upvote 0

Forum statistics

Threads
1,215,931
Messages
6,127,765
Members
449,405
Latest member
Pavesib

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top