moving row up and down with button and macro

jlachapelle7

New Member
Joined
Mar 16, 2012
Messages
3
Hi everyone and thank you for taking the time to help the needy one...;)..., I'm new to vb but I'm learning quick as I have been task to do a template for my cie. Here is my task. My sheet is as follow:

a ............b ................c
1 ----header line ( wont move)------
2.............................data1
3........button down....data1
4........empty line...............
5........empty line...............
6........button up........data2
7........button down....data2
8........empty line...............
9........empty line...............
10.......button up........data3
11.... ..button down....data3
12.......empty line...............
13.......empty line...............

etc.....
I can record a macro that move block data 2 to position of block data 1, eg: line 5 and 6 in place of 1 and 2. I select c2;c3, copy to empty line c4:c5. than I cut c6:c7 and paste it to c1;c2. Finally I cut c4:c5 back to c6:c7.

Ity work great, but I want to copy those button for hundreds of data block, but the macro always call the same range of cells, so it's a lot of macro to record. I wish I can copy those button and assign a macro that will select the range of cells of datafrom the origin cell of the button and move them accordinly. Colomn 1 and 2 won't move as well as as row1. Rows 2 don't have a move up button becasuse it's first line.
All my macros so far are in form.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,215,370
Messages
6,124,526
Members
449,169
Latest member
mm424

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