Auto Splitting of Data

Ruban S

New Member
Joined
Dec 31, 2019
Messages
35
Office Version
  1. 2016
Platform
  1. Windows
Dear,

I have data like this

SHORTLONGNOUNMODIFIERATT N1ATT V1ATT N2ATT V2ATT N3ATT V3
CHEMICAL,FAST-DRY SELF VULCANIZING CEMNTCHEMICAL, TYPE:FAST-DRY SELF VULCANIZING CEMENT, PACK SIZE:236.6MLCHEMICAL--TYPEPACK SIZE
CHEMICAL,FLUSH,LOCO,236.6MLCHEMICAL,FLUSH, BRAND:LOCO, PACK SIZE:236.6MLCHEMICALFLUSHMANUFACTURERBRANDPACK SIZE

I Need it like this

SHORTLONGNOUNMODIFIERATT N1ATT V1ATT N2ATT V2ATT N3ATT V3
CHEMICAL,FAST-DRY SELF VULCANIZING CEMNTCHEMICAL, TYPE:FAST-DRY SELF VULCANIZING CEMENT, PACK SIZE:236.6MLCHEMICAL--TYPEFAST-DRY SELF VULCANIZING CEMENTPACK SIZE236.6ML
CHEMICAL,FLUSH,LOCO,236.6MLCHEMICAL,FLUSH, BRAND:LOCO, PACK SIZE:236.6MLCHEMICALFLUSHMANUFACTURERBRANDLOCOPACK SIZE236.6ML

Likewise, I have many records, Please help me with some solution.
Data has to be Autofill based on LONG
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
What's the "key" to decide if you want ATT V1 versus ATT V2, etc.? Is it "TYPE" and "BRAND" ?
 
Upvote 0
Not fully tested with other options, but consider this an approach:

test..xlsx.xlsm
ABCDEFGHIJ
1SHORTLONGNOUNMODIFIERATT N1ATT V1ATT N2ATT V2ATT N3ATT V3
2CHEMICAL,FAST-DRY SELF VULCANIZING CEMNTCHEMICAL, TYPE:FAST-DRY SELF VULCANIZING CEMENT, PACK SIZE:236.6MLCHEMICAL--TYPEFAST-DRY SELF VULCANIZING CEMENTPACK SIZE236.6ML 
3CHEMICAL,FLUSH,LOCO,236.6MLCHEMICAL,FLUSH, BRAND:LOCO, PACK SIZE:236.6MLCHEMICALFLUSHMANUFACTURER BRANDLOCOPACK SIZE236.6ML
Sheet2
Cell Formulas
RangeFormula
F2:F3F2=IF(ISERROR(FIND("TYPE:",B2)),"",MID(B2,5+FIND("TYPE:",B2),(FIND("PACK",B2)-3)-(4+FIND("TYPE:",B2))))
H2:H3H2=IF(ISERROR(FIND("TYPE:",B2)),MID(B2,6+FIND("BRAND:",B2),4),RIGHT(B2,LEN(B2)-(FIND("SIZE:",B2)+4)))
J2:J3J2=IF("LOCO"=H2,RIGHT(B2,LEN(B2)-(FIND("SIZE:",B2)+4)),"")
 
Upvote 0
What's the "key" to decide if you want ATT V1 versus ATT V2, etc.? Is it "TYPE" and "BRAND" ?

Dear,

I dont want seperate formula for each cell. i need VBA program for the same. With reference to LONG cell description, Data (ATT V) has to split automatically against (ATT N). Same has mentioned in "I need it like this"
 
Upvote 0
If those formulas work for you, then put them into the VBA program that you're using.
Something like this:

Code:
Sub Ruban()
Dim LR As Long
LR = Cells(Rows.Count, "A").End(xlUp).Row
Range("F2:F" & LR).Formula = "=IF(ISERROR(FIND(""TYPE:"",B2)),"""",MID(B2,5+FIND(""TYPE:"",B2),(FIND(""PACK"",B2)-3)-(4+FIND(""TYPE:"",B2))))"
Range("H2:H" & LR).Formula = "=IF(ISERROR(FIND(""TYPE:"",B2)),MID(B2,6+FIND(""BRAND:"",B2),4),RIGHT(B2,LEN(B2)-(FIND(""SIZE:"",B2)+4)))"
Range("J2:J" & LR).Formula = "=IF(""LOCO""=H2,RIGHT(B2,LEN(B2)-(FIND(""SIZE:"",B2)+4)),"""")"
End Sub
 
Upvote 0
Dear,
This is an example. I have may Rows and columns like this. With respect to ATT N, it has to auto fetch ATT V from LONG. If ATT N is not available in LONG, it has to fill blank or "-" in ATT V.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
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