ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Move cells (https://www.excelbanter.com/excel-programming/275422-re-move-cells.html)

Tom Ogilvy

Move cells
 
Selection.offset(0,-1).Resize(,1).Delete Shift:=xltoleft
selection.offset(0,-1).Select


may or may not be useful

--
Regards,
Tom Ogilvy




"Wild Bill" wrote in message
...
Richard that is superbly succinct - too bad it doesn't reselect the way
he wants it to (I tried to adapt it but couldn't). Also you probably
meant to use -1 instead of 1.

On Wed, 27 Aug 2003 04:06:41 -0700, "Richard Daniels"
wrote:

Sub moveCells()
Selection.Cut Destination:=Range(Selection.Offset(0,
1).Address)
End Sub


-----Original Message-----
I need a quick macro that will take the current

selection
of cells and move them all one cell to the left,
overwriting the existing cell content.

I've got a huge spreadsheet (being used as a data source
for a Word merge) that needs this for lots of the

records
(59,000 of them!), and it's taking a long time grabbing

a
selection with the mouse and manually moving them
across. I'd like a macro I could assign to a shortcut
key and just select the required cells and hit and
shortcut key for as many 'left-shifts' of the cells as I
required.

Could anyone help me? Thanks

Steve
.





Wild Bill[_2_]

Move cells
 
Brilliant. At first glance my simple brain thought it would lose the
column width of the selection from the (,1) -- but of course it doesn't
since it operates on the offset, not the selection itself. Shrewd.

On Wed, 27 Aug 2003 08:59:10 -0400, "Tom Ogilvy"
wrote:

Selection.offset(0,-1).Resize(,1).Delete Shift:=xltoleft
selection.offset(0,-1).Select


may or may not be useful




All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com