Rearraging numbers so column c before is column a in next row

Fire7467

New Member
Joined
Jun 24, 2019
Messages
8
Rearranging numbers so column c before is column a in next row but also need it to but the last c row number in the next row if it applies
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 397"]
<colgroup><col><col span="2"></colgroup><tbody>[TR]
[TD]Pipe DTH03528[/TD]
[TD]DJ-0936[/TD]
[TD]Pipe DTH04898[/TD]
[/TR]
[TR]
[TD]Pipe DTH02677[/TD]
[TD]MLA-0435[/TD]
[TD]Pipe DTH03024[/TD]
[/TR]
[TR]
[TD]Pipe DTH05084[/TD]
[TD]DJ-0925[/TD]
[TD]Pipe DTH04298[/TD]
[/TR]
[TR]
[TD]Pipe DTH02033[/TD]
[TD]DJ-0261[/TD]
[TD]Pipe DTH03952[/TD]
[/TR]
[TR]
[TD]Pipe DTH03896[/TD]
[TD]MLA-0434[/TD]
[TD]Pipe DTH03528[/TD]
[/TR]
[TR]
[TD]Pipe DTH04291[/TD]
[TD]DJ-0922[/TD]
[TD]Pipe DTH03348[/TD]
[/TR]
[TR]
[TD]Pipe DTH02130[/TD]
[TD]MLA-0445[/TD]
[TD]Pipe DTH03824[/TD]
[/TR]
[TR]
[TD]Pipe DTH04898[/TD]
[TD]MLA-0433[/TD]
[TD]Pipe DTH03482[/TD]
[/TR]
[TR]
[TD]Pipe DTH04639[/TD]
[TD]MLA-0432[/TD]
[TD]Pipe DTH05084[/TD]
[/TR]
[TR]
[TD]Pipe DTH04292[/TD]
[TD]MLA-0446[/TD]
[TD]Pipe DTH03378[/TD]
[/TR]
[TR]
[TD]Pipe DTH03348[/TD]
[TD]MLA-0430[/TD]
[TD]Pipe DTH02881[/TD]
[/TR]
[TR]
[TD]Pipe DTH04171[/TD]
[TD]DJ-0263[/TD]
[TD]Pipe DTH03795[/TD]
[/TR]
[TR]
[TD]Pipe DTH03824[/TD]
[TD]DJ-0945[/TD]
[TD]Pipe DTH04908[/TD]
[/TR]
[TR]
[TD]Pipe DTH01743[/TD]
[TD]MLA-0183[/TD]
[TD]Pipe DTH04171[/TD]
[/TR]
</tbody>[/TABLE]

[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Do you mean to place ALL of the current column C below the current column A but still leave it in place in column C as well...as it shows in your example?

Is there anything that goes into the new rows in either column B or C?

Code:
Sub MoveColC()
Dim LR As Long
LR = Cells(Rows.Count, "A").End(xlUp).Row
'assume header in row 1
'copy column C below existng column A
Range("C2:C" & LR).Copy Destination:=Range("A" & LR + 1)
End Sub
 
Last edited:
Upvote 0
Do you mean to place ALL of the current column C below the current column A but still leave it in place in column C as well...as it shows in your example?

Is there anything that goes into the new rows in either column B or C?



the rows need to stay the same about to look at the script
 
Upvote 0
sorry just got off, I need it to read like this
[TABLE="width: 340"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Pipe DTH03528[/TD]
[TD]DJ-0936[/TD]
[TD]Pipe DTH04898[/TD]
[/TR]
[TR]
[TD]Pipe DTH04898[/TD]
[TD]MLA-0433[/TD]
[TD]Pipe DTH03482[/TD]
[/TR]
[TR]
[TD]Pipe DTH05084[/TD]
[TD]DJ-0925[/TD]
[TD]Pipe DTH04298[/TD]
[/TR]
[TR]
[TD]Pipe DTH04298[/TD]
[TD]MLA-0431[/TD]
[TD]Pipe DTH04291[/TD]
[/TR]
[TR]
[TD]Pipe DTH04291[/TD]
[TD]DJ-0922[/TD]
[TD]Pipe DTH03348[/TD]
[/TR]
[TR]
[TD]Pipe DTH03348[/TD]
[TD]MLA-0430[/TD]
[TD]Pipe DTH02881[/TD]
[/TR]
[TR]
[TD]Pipe DTH02881[/TD]
[TD]DJ-0931[/TD]
[TD]Pipe DTH03553[/TD]
[/TR]
[TR]
[TD]Pipe DTH03553[/TD]
[TD]MLA-0429[/TD]
[TD]Pipe DTH04278[/TD]
[/TR]
[TR]
[TD]Pipe DTH04278[/TD]
[TD]DJ-0927[/TD]
[TD]Pipe DTH00645[/TD]
[/TR]
[TR]
[TD]Pipe DTH00645[/TD]
[TD]MLA-0428[/TD]
[TD]Pipe DTH04625[/TD]
[/TR]
[TR]
[TD]Pipe DTH04625[/TD]
[TD]DJ-0923[/TD]
[TD]Pipe DTH04213[/TD]
[/TR]
[TR]
[TD]Pipe DTH04213[/TD]
[TD]MLA-0427[/TD]
[TD]Pipe DTH02870[/TD]
[/TR]
[TR]
[TD]Pipe DTH02870[/TD]
[TD]DJ-0930[/TD]
[TD]Pipe DTH00903[/TD]
[/TR]
[TR]
[TD]Pipe DTH00903[/TD]
[TD="align: center"]#N/A[/TD]
[TD="align: center"]#N/A[/TD]
[/TR]
</tbody>[/TABLE]

not use to scripts on Excel was trying to use formulas but Im runing into a loop cause I need to cross verify and Im trying to use a true/false if this already in the column my formula is as follows ingore the 1s and 2s not sure what happened was saying true or false but think you get it

A=COUNTIF($F$1:$F$9996,B8) B-D is info Im trying to sort E=IFNA(H10,VLOOKUP(FALSE,$B$1:$F$10000,2,FALSE)) F=VLOOKUP(F8,welds!$B$1:welds!$C$10015,2,FALSE) G
[TABLE="width: 833"]
<colgroup><col><col><col span="3"><col><col><col></colgroup><tbody>[TR]
[TD="align: center"]TRUE[/TD]
[TD]Pipe DTH03528[/TD]
[TD]DJ-0936[/TD]
[TD="colspan: 2"]Pipe DTH04898[/TD]
[TD]Pipe DTH03528[/TD]
[TD]DJ-0936[/TD]
[TD]Pipe DTH04898[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD]Pipe DTH02677[/TD]
[TD]MLA-0435[/TD]
[TD="colspan: 2"]Pipe DTH03024[/TD]
[TD]Pipe DTH04898[/TD]
[TD]MLA-0433[/TD]
[TD]Pipe DTH03482[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Pipe DTH05084[/TD]
[TD]DJ-0925[/TD]
[TD="colspan: 2"]Pipe DTH04298[/TD]
[TD]Pipe DTH05084[/TD]
[TD]DJ-0925[/TD]
[TD]Pipe DTH04298[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Pipe DTH02033[/TD]
[TD]DJ-0261[/TD]
[TD="colspan: 2"]Pipe DTH03952[/TD]
[TD]Pipe DTH04298[/TD]
[TD]MLA-0431[/TD]
[TD]Pipe DTH04291[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Pipe DTH03896[/TD]
[TD]MLA-0434[/TD]
[TD="colspan: 2"]Pipe DTH03528[/TD]
[TD]Pipe DTH04291[/TD]
[TD]DJ-0922[/TD]
[TD]Pipe DTH03348[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Pipe DTH04291[/TD]
[TD]DJ-0922[/TD]
[TD="colspan: 2"]Pipe DTH03348[/TD]
[TD]Pipe DTH03348[/TD]
[TD]MLA-0430[/TD]
[TD]Pipe DTH02881[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Pipe DTH02130[/TD]
[TD]MLA-0445[/TD]
[TD="colspan: 2"]Pipe DTH03824[/TD]
[TD]Pipe DTH02881[/TD]
[TD]DJ-0931[/TD]
[TD]Pipe DTH03553[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Pipe DTH04898[/TD]
[TD]MLA-0433[/TD]
[TD="colspan: 2"]Pipe DTH03482[/TD]
[TD]Pipe DTH03553[/TD]
[TD]MLA-0429[/TD]
[TD]Pipe DTH04278[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Pipe DTH04639[/TD]
[TD]MLA-0432[/TD]
[TD="colspan: 2"]Pipe DTH05084[/TD]
[TD]Pipe DTH04278[/TD]
[TD]DJ-0927[/TD]
[TD]Pipe DTH00645[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Pipe DTH04292[/TD]
[TD]MLA-0446[/TD]
[TD="colspan: 2"]Pipe DTH03378[/TD]
[TD]Pipe DTH00645[/TD]
[TD]MLA-0428[/TD]
[TD]Pipe DTH04625[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Pipe DTH03348[/TD]
[TD]MLA-0430[/TD]
[TD="colspan: 2"]Pipe DTH02881[/TD]
[TD]Pipe DTH04625[/TD]
[TD]DJ-0923[/TD]
[TD]Pipe DTH04213[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Pipe DTH04171[/TD]
[TD]DJ-0263[/TD]
[TD="colspan: 2"]Pipe DTH03795[/TD]
[TD]Pipe DTH04213[/TD]
[TD]MLA-0427[/TD]
[TD]Pipe DTH02870[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Pipe DTH03824[/TD]
[TD]DJ-0945[/TD]
[TD="colspan: 2"]Pipe DTH04908[/TD]
[TD]Pipe DTH02870[/TD]
[TD]DJ-0930[/TD]
[TD]Pipe DTH00903[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]Pipe DTH01743[/TD]
[TD]MLA-0183[/TD]
[TD="colspan: 2"]Pipe DTH04171[/TD]
[TD]Pipe DTH00903[/TD]
[TD="align: center"]#N/A[/TD]
[TD="align: center"]#N/A
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
I'm afraid I still don't understand what you want...maybe provide more info while I continue to look at it.
 
Upvote 0
Trying to make a chain.. have random numbers associated together in rows in the row there is 3 columns the 1st column is the head asset the 3rd is behind so the next (2)row needs the 1st rows 3rd column in column 1 and the number associated with the row its in in the third column and so on to make a chain.. the chain is in pieces at the moment so there will be loose end but still need those the same way
 
Upvote 0
In post #4 , is the top table where it begins and the bottom table in that post is what you want to end up with?

The bottom table has Pipe DTH02677 but the top table doesn't have that anywhere. So, where did that come from?
 
Upvote 0
Didnt realized it but its not working was just manually doing it to show you but it should be there too
 
Upvote 0
It would help me if you gave me an possible input table and the result table you expect. Thanks.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

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