Hello,
Here my challenge:
I've placed 4 rectangles - one below each other (with a little bit of space inbetween). I've named them R1, R2, R3 and R4. There current position is
(...).Left = 60 (for all)
(...).Top = 60 (for R1), 80 (for R1), 100 (for R1) & 120 (for R1)
My goal is to be capable to re-order them by moving the shapes: if I click with my mouse on "R4" and move it up somewhere inbetween "R1" and "R2", I want (after releasing my mouse) to see "R1" staying at its first position, "R4" beeing at the second position (coordinates: .Left = 60 and .Top = 80), "R2" moving down to the 3rd position and "R3" moving down to the last position. New order beeing R1-R4-R2-R3.
My approach so far is to have two table: One providing the .Left and .Top coordinates for the 4 expected positions (reference table) and the other one gathering the .Left and .Top positions of the 4 rectangles. I can anytime (upon demand) check the real position of the 4 rectangles and decide, based on their real position, in which order I want to see them appearing in their respective positions. So if I move "R4" manually inbetween "R1" and "R2", my "real position table" will show that the .Top value for "R4" is now the second lowest => I can reorder the 4 rectangles as expected: "R1", "R4", "R2", "R3"
My problem: today i need to click on a buton to update the "real position table". I want the macro to start as soon as a position move has been detected.
Any suggestions? best practises?
Thank you
Laurent
Here my challenge:
I've placed 4 rectangles - one below each other (with a little bit of space inbetween). I've named them R1, R2, R3 and R4. There current position is
(...).Left = 60 (for all)
(...).Top = 60 (for R1), 80 (for R1), 100 (for R1) & 120 (for R1)
My goal is to be capable to re-order them by moving the shapes: if I click with my mouse on "R4" and move it up somewhere inbetween "R1" and "R2", I want (after releasing my mouse) to see "R1" staying at its first position, "R4" beeing at the second position (coordinates: .Left = 60 and .Top = 80), "R2" moving down to the 3rd position and "R3" moving down to the last position. New order beeing R1-R4-R2-R3.
My approach so far is to have two table: One providing the .Left and .Top coordinates for the 4 expected positions (reference table) and the other one gathering the .Left and .Top positions of the 4 rectangles. I can anytime (upon demand) check the real position of the 4 rectangles and decide, based on their real position, in which order I want to see them appearing in their respective positions. So if I move "R4" manually inbetween "R1" and "R2", my "real position table" will show that the .Top value for "R4" is now the second lowest => I can reorder the 4 rectangles as expected: "R1", "R4", "R2", "R3"
My problem: today i need to click on a buton to update the "real position table". I want the macro to start as soon as a position move has been detected.
Any suggestions? best practises?
Thank you
Laurent