Split different parts in different columns

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Split different parts in different columns

Post by YasserKhalil »

Hello everyone
I have some strings like that
31 male 46 46 ذكر sleep ینام

How can I separate each part in a column to be like that?
male ذكر sleep ينام
I mean to have the English words and the Arabic words in four columns.

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Split different parts in different columns

Post by HansV »

Have you tried the Range.TextToColumns method?
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Re: Split different parts in different columns

Post by YasserKhalil »

Yes I have tried TextToColumns but sometimes there are more than a word in one column that should be together. I don't need to rely on just spaces. Maybe the numbers existing is the key to split the words.

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Split different parts in different columns

Post by HansV »

That would be difficult. Could you attach a workbook with some samples that are representative of the data that you want to split?
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Re: Split different parts in different columns

Post by YasserKhalil »

Here's sample file
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Split different parts in different columns

Post by HansV »

See the attached version.

Sample File.xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Re: Split different parts in different columns

Post by YasserKhalil »

Amazing solution. Thank you very much.