Move parts of the text from one column to another

zack8576

Active Member
Joined
Dec 27, 2021
Messages
271
Office Version
  1. 365
Platform
  1. Windows
I need to use VBA to move the first 3 characters from column O to in front of the text in column K, so in the example below
it should look like: J-7,4x8',Base,8"w,96"
appreciate your help !

Capture.PNG
 

Attachments

  • Capture.PNG
    Capture.PNG
    24.4 KB · Views: 3

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Any chance you can post your data with XL2BB - Excel Range to BBCode

Order#Str#QuantityItem#Job Req'd?Piece#Job#PriceSourceWeightDescriptionPART - Height (Int)PART - Catalog IDMH - SpecMH - Type
CF25684BU-06 E INLET
1​
F22143J-54"YesP1F25684AI01
0​
Production7387 lbE Box,6"w54"54"FDOT 425-052,001E BOXES
CF25684BU-06 E INLET
1​
NoP2F25684AI02
0​
Production2 lbCHAIN & EYEBOLT0"2 @ 30"FDOT 425-052,001E BOXES
CF25684BU-06 E INLET
1​
F906608NoP3F25684AI03
0​
Purchased215 lbUSF 6608 GRATE0"FDOT 425-052,001E BOXES
CF25684BU-06 E INLET
1​
No
0​
Purchased-964 lbHOLE 42"0"FDOT 425-052,001E BOXES
CF25684BU-05A E INLET
1​
F22143J-54"YesP1F25684AM01
0​
Production7387 lbE Box,6"w54"54"FDOT 425-052,001E BOXES
CF25684BU-05A E INLET
1​
NoP2F25684AM02
0​
Production2 lbCHAIN & EYEBOLT0"2 @ 30"FDOT 425-052,001E BOXES
CF25684BU-05A E INLET
1​
F03370NoP3F25684AM03
0​
Purchased215 lbUSF 6608 GRATE0"FDOT 425-052,001E BOXES
CF25684BU-05A E INLET
1​
No
0​
Purchased-964 lbHOLE 42"0"FDOT 425-052,001E BOXES
CF25684BU-07D E INLET
1​
F22143J-66"YesP1F25684AN01
0​
Production8662 lbE Box,6"w66"66"FDOT 425-052,001E BOXES
CF25684BU-07D E INLET
1​
NoP2F25684AN02
0​
Production2 lbCHAIN & EYEBOLT0"2 @ 30"FDOT 425-052,001E BOXES
CF25684BU-07D E INLET
1​
F03370NoP3F25684AN03
0​
Purchased215 lbUSF 6608 GRATE0"FDOT 425-052,001E BOXES
CF25684BU-07D E INLET
1​
No
0​
Purchased-1257 lbHOLE 48"0"FDOT 425-052,001E BOXES
CF25684BU-08 E INLET
1​
F22143J-60"YesP1F25684AQ01
0​
Production8025 lbE Box,6"w60"60"FDOT 425-052,001E BOXES
CF25684BU-08 E INLET
1​
NoP2F25684AQ02
0​
Production2 lbCHAIN & EYEBOLT0"2 @ 30"FDOT 425-052,001E BOXES
CF25684BU-08 E INLET
1​
F03370NoP3F25684AQ03
0​
Purchased215 lbUSF 6608 GRATE0"FDOT 425-052,001E BOXES
CF25684BU-08 E INLET
1​
No
0​
Purchased-725 lbHOLE 36"0"FDOT 425-052,001E BOXES
CF25684BU-12A E INLET
1​
F21143J-48"YesP1F25684AO01
0​
Production6750 lbE Base,6"w48"48"FDOT 425-052,001E BASES
CF25684BU-12A E INLET
1​
F21242J-24"NoP2F25684AO02
0​
Production2550 lbE Collar,6"w24"24"FDOT 425-052,001E BASES
CF25684BU-12A E INLET
1​
NoP3F25684AO03
0​
Production2 lbCHAIN & EYEBOLT0"2 @ 30"FDOT 425-052,001E BASES
CF25684BU-12A E INLET
1​
F03370NoP4F25684AO04
0​
Purchased215 lbUSF 6608 GRATE0"FDOT 425-052,001E BASES
CF25684BU-12A E INLET
1​
No
0​
Purchased-1257 lbHOLE 48"0"FDOT 425-052,001E BASES
CF25684DM-07H J MANHOLE
1​
F13210J-80"YesP1F25684AR01
0​
Production23514 lb4x8',Base,8"w80"80"FDOT 425-010,001J-7 STORM MANHOLE
CF25684DM-07H J MANHOLE
1​
F13245RNoP2F25684AR02
0​
Production3721 lbTS,64x112",48"OS,TNG8"8"FDOT 425-010,001J-7 STORM MANHOLE
CF25684DM-07H J MANHOLE
1​
F14448NoP3F25684AR03
0​
Production2683 lbMH,4'dia,Cone,Ecc,5"w48"48"FDOT 425-010,001J-7 STORM MANHOLE
CF25684DM-07H J MANHOLE
1​
NoP4F25684AR04
0​
Production419 lbADJUSTMENT6"6"FDOT 425-010,001J-7 STORM MANHOLE
CF25684DM-07H J MANHOLE
1​
F90170NoP5F25684AR05
0​
Production150 lbUSF 170 RING6"6"FDOT 425-010,001J-7 STORM MANHOLE
CF25684DM-07H J MANHOLE
1​
NoP6F25684AR06
0​
Production130 lbUSF CM COVER0""C/O Orlando,The City Beautiful Storm,FL"FDOT 425-010,001J-7 STORM MANHOLE
 
Upvote 0
So in your last column you have text like " e bases" or text starting with " J-7 ". What has to go where ? ( in your original picture only strings starting with J-7)
 
Upvote 0
take the J-7 as an example:
column K:
4x8',Base,8"w

column O:
J-7 STORM MANHOLE
I just need the J-7 to go in front of the 4x8, like this
J-7 4x8',Base,8"w
 
Upvote 0
I need to use VBA to move the first 3 characters from column O to in front of the text in column K, so in the example below
it should look like: J-7,4x8',Base,8"w,96"
appreciate your help !

View attachment 72536
This is what I have so far

VBA Code:
Sub StructureID() 'Add structure ID to P1
     c4 As Range
     For Each c4 In rng
        If c4 Like "*Base*" Then
            c4 = c4.Offset(, 4) & "," & c4
        End If
     Next c4
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

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