Loop to move column contents

XfortunaX

New Member
Joined
Aug 28, 2014
Messages
28
Hi!

I am currently stuck. I am attempting to create a loop that goes from the bottom of the range up in column F. If nothing is in the cell, move to the next row. If a cell in column F has content, moving the content from D, E, and F to the left. I was manually going into column C and delete Shift:=xlToLeft. I cannot get the loop to work.

From this:
[TABLE="width: 730"]
<tbody>[TR]
[TD]CheckNumber[/TD]
[TD]RoutingNumber[/TD]
[TD]AccountNumber[/TD]
[TD]Amount[/TD]
[TD="align: right"]2004004142[/TD]
[TD]-[/TD]
[TD]H[/TD]
[TD]SALES[/TD]
[TD]LLC[/TD]
[/TR]
[TR]
[TD="align: right"]11062[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$2,390.31[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1115[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$2,000.00[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]3219[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$166.64[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]995930[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$5,630.89[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]125124[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$1,374.06[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]559145[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122[/TD]
[TD] 122-12222-001[/TD]
[TD="align: right"]$800.00[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]4219[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$1,500.00[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

To this:
[TABLE="width: 730"]
<tbody>[TR]
[TD]CheckNumber[/TD]
[TD]RoutingNumber[/TD]
[TD]AccountNumber[/TD]
[TD]Amount[/TD]
[TD="align: right"]2004004142[/TD]
[TD]-[/TD]
[TD]H[/TD]
[TD]SALES[/TD]
[TD]LLC[/TD]
[/TR]
[TR]
[TD="align: right"]11062[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$2,390.31[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1115[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$2,000.00[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]3219[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$166.64[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]995930[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$5,630.89[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]125124[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$1,374.06[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]559145[/TD]
[TD="align: right"]1111111[/TD]
[TD] 122-12222-001[/TD]
[TD="align: right"]$800.00[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]4219[/TD]
[TD="align: right"]1111111[/TD]
[TD="align: right"]122222[/TD]
[TD="align: right"]$1,500.00[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thank you!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
How about
Code:
Sub XfortunaX()
   Range("F2:F" & Rows.Count).SpecialCells(xlConstants).Offset(, -3).Delete xlToLeft
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

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