Separation of compound names, within the name

shimaa01234

Active Member
Joined
Jun 24, 2014
Messages
446
Can you separate the compound names in Arabic
Such as:
Abdel Rahman, Abdel Massih
Using the formula
Separation of compound names, within the name,
Name the compound so that, in a single column
And the rest, all in the name of a separate column
Like this table

Mohammed Abdel Rahman BayoumiMohammedAbdel RahmanBayoumi
Abdel Rahim Mustafa Tayeb Abdel RahimMustafaTayeb
Elias Abdel Massih CharlesEliasAbdel MassihCharles

<tbody>
</tbody>
 
Last edited:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How to add other names to this code
I tried to add names, such as the way in the existing code, but give me the result of an error
Unfortunately, again
 
Last edited:
Upvote 0
How to add other names to this code
I tried to add names, such as the way in the existing code, but give me the result of an error
Unfortunately, again

This discussion will be continued as soon as I get all of these data:

- I provided 3 solutions for the name-patterns available so far, which solution are you using (number of the post)?
- How did you try to add new names and what happened?
- If the new names represent new name-patterns how should they be separated?
 
Upvote 0
Mister "Istvan"
The formula works nicely
But I tried, the use of code, and add a few names like this

Sub Sepnames()
Dim c As Range
Dim lc, uc As String
'For example:
lc = "a21" 'First cell
uc = "a29" 'Last cell
For Each c In ActiveSheet.Range(lc, uc)
c.Offset(, 1) = Replace(Replace(Replace(c, " ", ";"), "Abd;", "Abd "), "Alaa;", "Alaa "), "Abou;", "Abou ")
Next
Application.DisplayAlerts = False
Range(lc, uc).Offset(, 1).Select
Selection.TextToColumns Destination:=Range(lc).Offset(, 1), DataType:=xlDelimited, _
semicolon:=True
Application.DisplayAlerts = True
End Sub


But it showed an error
I'm sorry I come back again, after the end of the discussion
 
Upvote 0
Mister "Istvan"
The formula works nicely
But I tried, the use of code, and add a few names like this

Sub Sepnames()
Dim c As Range
Dim lc, uc As String
'For example:
lc = "a21" 'First cell
uc = "a29" 'Last cell
For Each c In ActiveSheet.Range(lc, uc)
c.Offset(, 1) = Replace(Replace(Replace(c, " ", ";"), "Abd;", "Abd "), "Alaa;", "Alaa "), "Abou;", "Abou ")
Next
Application.DisplayAlerts = False
Range(lc, uc).Offset(, 1).Select
Selection.TextToColumns Destination:=Range(lc).Offset(, 1), DataType:=xlDelimited, _
semicolon:=True
Application.DisplayAlerts = True
End Sub


But it showed an error
I'm sorry I come back again, after the end of the discussion

If you want to process another part of column A, you have to set the first cell (green) and the last cell (blue) of the range to process. For example, if the first cell is A2 then change the green value to A2 in line 5:

lc = "a2" 'First cell

and if the last cell is, for example, A1500 then set the last cell to process in line 6:

uc = "a1500" 'Last cell

Do not forget to save the workbook as .xlsm.

Code:
Sub Sepnames()
Dim c As Range
Dim lc, uc As String
'For example:
lc = "[B][COLOR=#006400]a21[/COLOR][/B]"   'First cell
uc = "[B][COLOR=#0000cd]a29[/COLOR][/B]"   'Last cell
        For Each c In ActiveSheet.Range(lc, uc)
          c.Offset(, 1) = Replace(Replace(Replace(c, " ", ";"), "Abd;", "Abd "), "Alaa;", "Alaa ")
        Next
    Application.DisplayAlerts = False
    Range(lc, uc).Offset(, 1).Select
    Selection.TextToColumns Destination:=Range(lc).Offset(, 1), DataType:=xlDelimited, _
    semicolon:=True
    Application.DisplayAlerts = True
End Sub

Let me know if it works now.
 
Upvote 0
But I tried, the use of code, and add a few names like this

c.Offset(, 1) = Replace(Replace(Replace(c, " ", ";"), "Abd;", "Abd "), "Alaa;", "Alaa "), "Abou;", "Abou ")
But it showed an error
 
Upvote 0
But I tried, the use of code, and add a few names like this

c.Offset(, 1) = Replace(Replace(Replace(c, " ", ";"), "Abd;", "Abd "), "Alaa;", "Alaa "), "Abou;", "Abou ")
But it showed an error

If you want to add „Abou” because this word has the same role az „Abd” or „Alaa”, inserting the new word to the end of the line is not enough, the beginning of the line also has to be changed like this (note the added Replace function):

Sub Sepnames()
Dim c As Range
Dim lc, uc As String
'For example:
lc = "a1" 'First cell
uc = "a9" 'Last cell
For Each c In ActiveSheet.Range(lc, uc)
c.Offset(, 1) = Replace(Replace(Replace(Replace(c, " ", ";"), "Abd;", "Abd "), "Alaa;", "Alaa "), "Abou;", "Abou ")
Next
Application.DisplayAlerts = False
Range(lc, uc).Offset(, 1).Select
Selection.TextToColumns Destination:=Range(lc).Offset(, 1), DataType:=xlDelimited, _
semicolon:=True
Application.DisplayAlerts = True
End Sub
Excel Workbook
ABCDE
1Abd Rahman Samir AliAbd RahmanSamirAli
2Abd Allah Ibrahim MarzoukiAbd AllahIbrahimMarzouki
3Samira Syed Abd ElMominSamiraSyedAbd ElMomin
4Alaa ElDin Mohamed AliAlaa ElDinMohamedAli
5Peter Michel Abd ElMassihPeterMichelAbd ElMassih
6Abd Elaziz Ibrahim Abd ElrahmanAbd ElazizIbrahimAbd Elrahman
7Abd Elaziz Ibrahim Abd Elrahman MohammedAbd ElazizIbrahimAbd ElrahmanMohammed
8Abd ElRahman Abd ElAziz Mohammed IbrahimAbd ElRahmanAbd ElAzizMohammedIbrahim
9Abou Syed Abd ElMominAbou SyedAbd ElMomin
Sheet
 
Upvote 0
Wonderful
Code is excellent, and the formula Genius
Thank you very much
And unfortunately for the time you spent with me for Educational
Thanks again, you're a nice guy
 
Upvote 0

Forum statistics

Threads
1,215,410
Messages
6,124,755
Members
449,187
Latest member
hermansoa

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