PDA

View Full Version : Drag Drop Reorder part of Row .. Excel



Southernwave
01-06-2017, 08:18 PM
I have a worksheet where I need to reorder the sequence of rows.

Currently I add a numbered sort column and then sort the rows (actually part of the row) with a macro.

What I would like to do is move rows (actually part of the row) up and down by select and drop.

A couple of issues.. I want to move a (pre set) number of cells in the row.. so other cells that do calcs stay in place

I want to move all the ,below where I want the moving rows to go, down to place the moving row
The row would be moved and not pasted
No data would be lost via the operation
Maybe the option to move any cell conditioning with the moving row.

All the methods I see at the moment are cut and paste (so data lost) or move the row occupying the slot to the bottom of the list.

Has anyone tried ( and succeeded) to do this sort of thing ?

Cheers

Andrew

offthelip
01-09-2017, 05:50 PM
Your query has been up for as number of days, and nobody has deemed to answer it, that could be because it is unclear what you are asking.
You seem to be stuck on how to move data around a spread sheet with vba. Cut and paste is one way, but I virtually never use that, my favourite method of moving data around is to load the data into an array, process it to a second array, and then write out second the array

For example, this sub reverses the order of A1 to A10

[VBASub test()
inarr = Range(Cells(1, 1), Cells(10, 1))
outarr = Range(Cells(1, 1), Cells(10, 1))


For i = 1 To 10
outarr(11 - i, 1) = inarr(i, 1)
Next i
Range(Cells(1, 1), Cells(10, 1)) = outarr




End Sub


[/VBA]