Split text Column to 30 char and not cut word

pwebb

New Member
Joined
Feb 21, 2013
Messages
11
I have textin column B that is 5 to 50 characters long and need to split the text up totwo columns of 30 and not split a word the fun part is that in column B I needto pull out 2 characters to column D and E that are in brackets (AB) first setto D and second to E. Any help will be appreciated <o:p></o:p>
<o:p> </o:p>
Sample ofthe data I am working with<o:p></o:p>
[TABLE="class: MsoNormalTable, width: 584"]
<tbody>[TR]
[TD="width: 347, bgcolor: transparent"] description 1<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"] description 2<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"] Suffix 1<o:p></o:p>
[/TD]
[TD="width: 107, bgcolor: transparent"] Suffix 2<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] ROLLER<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] INSIDE HORIZONTAL VISE FIXED JAW<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] OUTSIDE HORIZONTAL VISE FIXED JAW<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] OUTSIDE HORIZONTAL VISE MOVEABLE JAW<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] SAW BLADE GUIDE PLATE ( DOOR SIDE )<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] SAW BLADE GUIDE PLATE ( GEAR BOX SIDE )<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] SAW FLANGE ( P.C.D 63)<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] CENTER COLLAR (FOR SAW BLADE )<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] PUMP (ST)(RP)<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] KNURLED SCREW - OUTSIDE HEAT TREAT<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] BAR FL 1.00X3.00X1.13 ALUM 6061-T6511<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] SPR CPRSN (BP)<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 347, bgcolor: transparent"] BARLOADER VERT. ROLLER<o:p></o:p>
[/TD]
[TD="width: 203, bgcolor: transparent"][/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 107, bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
<o:p> </o:p>
 
...should work assuming there are no bracketed characters preceding the two character sets.
Good point (thanks for mentioning it)... that restriction also applies to the final formulas I posted in Message #9 as well. If you haven't already done so, you might find my formulas of interest as they work directly without resorting to manually applying TextToColumns.
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Yes, thanks for that, Rick. I always find your postings interesting (you're much better at this stuff than I am). Your solution is much more elegant than mine. I just find it a good learning exercise to try and answer this in my own fashion.

Cheers, :)
 
Upvote 0
Rick,<o:p></o:p>
<o:p> </o:p>
Thanks forthe formulas it seem to work only on some cell I have attach an example see red,<o:p></o:p>
[TABLE="class: MsoNormalTable, width: 533"]
<tbody>[TR]
[TD="width: 207, bgcolor: transparent"]
B<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]
C<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"]
D<o:p></o:p>
[/TD]
[TD="width: 99, bgcolor: transparent"]
E<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"]
F<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]
Data<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]
Desc 1<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"]
Desc 2<o:p></o:p>
[/TD]
[TD="width: 99, bgcolor: transparent"]
Suf 1<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"]
Suf 2<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] PLATE (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] PLATE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"] (RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] PLATE<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] PLATE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"][/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] PLATE<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] PLATE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"][/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] PLATE<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] PLATE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"][/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] VISE JAW (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] VISE JAW<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"] (RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] VISE JAW (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] VISE JAW<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"] (RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] SAW FLANGE (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] SAW FLANGE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"] (RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] CENTER COLLAR (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] CENTER COLLAR<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"] (RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] SAW FLANGE (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] SAW FLANGE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"] SAW FLANGE<o:p></o:p>
[/TD]
[TD="width: 99, bgcolor: transparent"] (RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] CENTER COLLAR (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] CENTER COLLAR<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"] (RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] CENTER COLLAR<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] CENTER COLLAR<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"][/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"] BRAKE DISC (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"] BRAKE DISC<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"] (RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
<o:p> </o:p>
I do have a questioncan the (XX) be just moved to column E and F then the 30 Charter split be doneto C and D also would it be easier to accomplish this with VBA? <o:p></o:p>
<o:p> </o:p>
Thanks againfor all you help<o:p></o:p>
 
Upvote 0
Rick,<o:p></o:p>
<o:p></o:p>
Thanks forthe formulas it seem to work only on some cell I have attach an example see red,<o:p></o:p>
[TABLE="class: MsoNormalTable, width: 533"]
<TBODY>[TR]
[TD="width: 207, bgcolor: transparent"]
B<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]
C<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"]
D<o:p></o:p>
[/TD]
[TD="width: 99, bgcolor: transparent"]
E<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"]
F<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]
Data<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]
Desc 1<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"]
Desc 2<o:p></o:p>
[/TD]
[TD="width: 99, bgcolor: transparent"]
Suf 1<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"]
Suf 2<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]PLATE (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]PLATE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"](RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]PLATE<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]PLATE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"][/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]PLATE<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]PLATE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"][/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]PLATE<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]PLATE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"][/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]VISE JAW (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]VISE JAW<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"](RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]VISE JAW (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]VISE JAW<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"](RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]SAW FLANGE (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]SAW FLANGE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"](RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]CENTER COLLAR (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]CENTER COLLAR<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"](RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]SAW FLANGE (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]SAW FLANGE<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"]SAW FLANGE<o:p></o:p>
[/TD]
[TD="width: 99, bgcolor: transparent"](RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]CENTER COLLAR (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]CENTER COLLAR<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"](RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]CENTER COLLAR<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]CENTER COLLAR<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"][/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 207, bgcolor: transparent"]BRAKE DISC (RP)<o:p></o:p>
[/TD]
[TD="width: 188, bgcolor: transparent"]BRAKE DISC<o:p></o:p>
[/TD]
[TD="width: 123, bgcolor: transparent"][/TD]
[TD="width: 99, bgcolor: transparent"](RP)<o:p></o:p>
[/TD]
[TD="width: 95, bgcolor: transparent"][/TD]
[/TR]
</TBODY>[/TABLE]
<o:p></o:p>
I do have a questioncan the (XX) be just moved to column E and F then the 30 Charter split be doneto C and D also would it be easier to accomplish this with VBA? <o:p></o:p>
<o:p></o:p>
Thanks againfor all you help<o:p></o:p>
When I copy/paste the data you posted and put my formulas into the worksheet, I do not get that anomoly that you posted... the formulas all produce the correct values. The only thing I can think of is there is some kind of "extra" non-visible character in your text, but to tell you the truth, I cannot think of any character off the top of my head would do what you show. You should still have my address... send me the workbook that is doing this and I'll look at it later tonight to see what is going on. I'll also look into giving you a macro that does the split after pulling out the two-character suffixes.
 
Upvote 0
Rick,<o:p></o:p>

Thanks for the quick response; the workbook is 130MB, one thing I did notice that when I post the section of the spreadsheet it is taking out the extra space between the SAW FLANGE and (RP)

It lookslike the issue is an extra space between the SAW and FLANGE that looks like it is the cause

there is two spaces between SAW and FLANGE I remove one and all is good but there are 850000 rows :([TABLE="width: 347"]
<tbody>[TR]
[TD]SAW FLANGE (RP)
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Rick,

Just wanted to say thanks again for all of your help and expertise, I was able to create a macro from the code you provided.
This is what I came up with and it seems to work, you can let me know if I should have done it differently.

Sub Split_30()
'
' Created on 2/25/2013
'
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("C:F").Select
Selection.ColumnWidth = 20
Range("C1").Select
ActiveCell.FormulaR1C1 = "Description 1"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Description 2"
Range("E1").Select
ActiveCell.FormulaR1C1 = "Suffix 1"
Range("F1").Select
ActiveCell.FormulaR1C1 = "Suffix 2"
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C2").Select
ActiveCell.FormulaR1C1 = "=TRIM(RC[-1])"
Selection.AutoFill Destination:=Range("C2:C85634")
Range("C2:C85634").Select
Columns("D:D").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("C:C").Select
Selection.Copy
Columns("D:D").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("C:C").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft
Range("C2").Select
ActiveCell.FormulaR1C1 = _
"=TRIM(LEFT(RC[-1],MIN(IF(AND(NOT(ISNUMBER(SEARCH("" (??)*"",RC[-1]))),LEN(RC[-1])<31),LEN(RC[-1]),FIND(""("",RC[-1]&""("")-1),30-LEN(TRIM(RIGHT(SUBSTITUTE(LEFT(RC[-1]&"" "",31),"" "",REPT("" "",99)),99))))))"
Range("D2").Select
ActiveCell.FormulaR1C1 = _
"=TRIM(SUBSTITUTE(IF(LEN(RC[1]&RC[2]),SUBSTITUTE(RC[-2],"" ""&RC[1]&RC[2],""""),RC[-2]),RC[-1],""""))"
Range("E2").Select
ActiveCell.FormulaR1C1 = _
"=IF(ISNUMBER(SEARCH("" (??)*"",RC[-3])),MID(RC[-3],SEARCH("" (??)*"",RC[-3])+1,4),"""")"
Range("E3").Select
ActiveCell.FormulaR1C1 = ""
Range("F2").Select
ActiveCell.FormulaR1C1 = _
"=IF(ISNUMBER(SEARCH("" (??)(??)"",RC[-4])),MID(RC[-4],SEARCH("" (??)(??)"",RC[-4])+5,4),"""")"
Range("C2:F2").Select
Selection.AutoFill Destination:=Range("C2:F85634")
Range("C2:F85634").Select
Columns("G:G").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveWindow.SmallScroll ToRight:=1
Columns("C:F").Select
Selection.Cut
Columns("C:F").Select
Application.CutCopyMode = False
Selection.Copy
Columns("G:J").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("C:F").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("B:B").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
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