jnash67
asked on
Excel VBA - Drag and Drop Columns
I would like to enable a user to re-order columns. When the user clicks down on the column header and hold the mouse down, I would like the column or some shape to become movable with the mouse. When they let go of the mouse, I would then move the column to where they let go.
Does someone have some code that does most of this that I can cannibalize.
Does someone have some code that does most of this that I can cannibalize.
Begs the question - why can't they just drag and drop anyway?
ASKER
It's in the context of a VBA dictator application where Excel is heavily modified.
There's a lot more details about the whys at https://www.experts-exchange.com/questions/25008923/Excel-VBA-Drag-and-Drop-Columns.html
There's a lot more details about the whys at https://www.experts-exchange.com/questions/25008923/Excel-VBA-Drag-and-Drop-Columns.html
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm going with Rory's approach. The problem with Patrick's approach was that the user still had to position cursor at the very edge and the program had no notification when the drag and drop was completed or where the column had been moved to.
I've started off with the code from: http://www.dailydoseofexcel.com/archives/2007/01/11/listbox-drag-and-drop/
Any ideas of how to highlight where an item is going to be dragged and dropped? If not, any sample code for a listbox approach with an up and down button implemented?
I've started off with the code from: http://www.dailydoseofexcel.com/archives/2007/01/11/listbox-drag-and-drop/
Any ideas of how to highlight where an item is going to be dragged and dropped? If not, any sample code for a listbox approach with an up and down button implemented?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
jnash67 - Thanks for the points - Patrick