Macro to move two cells up deleting the two above cell

bumperjoe

New Member
Joined
Feb 4, 2006
Messages
33
hello,
I need to move a cell (A2) and it's adjacent cell(B2) up and delete the two cells above it (A1) and (B1)



Thanks
 
Last edited:
Re: how to use a macro to move two cells up deleting the two above cell

i confused delete with clearing. i did not know. can you move them up and clear the above cells
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Re: how to use a macro to move two cells up deleting the two above cell

Tell me again.

When you doubleclick on "A5" what do you want to happen?

And when you say the above cells. Do you mean "A4"

Or do you mean "A1" "A2" "A3"

And when you say you have thousands of these to do. Why not tell me what makes you decide which ones.
 
Upvote 0
Re: how to use a macro to move two cells up deleting the two above cell

I do not understand why you seem to be saying clear the cell and then shift ever thing in that column up.
What is the reason why your opposed to deleting the cell which shifts every thing up?
 
Upvote 0
Re: how to use a macro to move two cells up deleting the two above cell

i am combining 2 different price lists. there are over 60k parts.
there are 10 columns of information and both lack info the other has. so together the are complete
the bottom part has the correct price 37.00 and 25.00. those prices 37.00 and 25.00 need to be copies to the others
part# p1 p2
CH1250128 8.75 23.00
CH1250128 8.75 23.00
CH1250128 8.75 23.00
CH1250128 37.00 25.00
to
CH1250128 37.00 25.00
CH1250128 37.00 25.00
CH1250128 37.00 25.00
CH1250128 37.00 25.00

part# is "B"
p1 is H"
p2 is "I"
 
Upvote 0
Re: how to use a macro to move two cells up deleting the two above cell

If you have 60,000 rows of data to check you surely cannot do this one at a time.

So in column "B" you have part numbers.
In column H you have "P1" which I guess that means Price 1
In column I you have "P2" which I assume that means Price 2

So are you saying you want to go down all 60,000 rows and change the value in column (H) to the value in Column (I)

See when you use terms like "P1" we have no way of knowing what that means.
 
Upvote 0
Re: how to use a macro to move two cells up deleting the two above cell

If I understand you correctly, try this
Code:
Sub CopyMe()
   Dim cnt As Long
   For cnt = 2 To Range("B" & Rows.Count).End(xlUp).Row Step 4
      Range("H" & cnt).Resize(3, 2).Value = Range("H" & cnt + 3).Resize(, 2).Value
   Next cnt
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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