Solve problems with splitting names in Excel

Опубликовано: 16 Июль 2026
на канале: Barb Henderson
1,273
10

Solve problems with splitting names in Excel. Works for "&" between initials or between first names. Check out my online courses www.easyexcelanswers.com/courses.html
All my courses include online support and a user manual
Let me teach you the VBA that I have learn in my five years of consulting
https://www.easyexcelanswers.com/Into...

Let's take the frustration out of user forms
https://www.easyexcelanswers.com/User...

Become an Affiliate and earn 25% on Course Sales
https://barb-s-school-c482.thinkific....

For more help visit my website www.easyexcelanswers.com or email me at [email protected].

Contact me regarding customizing this template for your needs.

Click for online Excel Consulting http://www.calendly.com/easyexcelanswers

I am able to provide online help on your computer at a reasonable rate.

https://www.amazon.com/shop/barbhende...

I use a Blue condenser Microphone to record my videos, here is the link
https://amzn.to/37gyyGa

Check out Crowdcast for creating your webinars
https://app.linkmink.com/a/crowdcast/83

If you need to buy Office 2019 follow
https://amzn.to/2VX5dv8

I use Tube Buddy to help promote my videos
Check them out
https://www.Tubebuddy.com/easyexcelan...

Follow me on Facebook
  / easyexcel.answers  

TWEET THIS VIDEO    • Solve problems with splitting names in Excel  

Follow me on twitter
easyexcelanswers

IG @barbhendersonconsulting

You can help and generate a translation to you own language
http://www.youtube.com/timedtext_cs_p...

*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I've used or have experience with.

All templates, with code, are available for purchase for $50 USD

code
Sub splitname()

Dim name As String
Dim fname As String
Dim lname As String
Dim intoPos As Integer
Dim x As Integer

Worksheets("sheet1").Select
x = 2

Do While Cells(x, 1) (does not equal)""
name = Sheet1.Cells(x, 1)
intPos = InStr(name, " ") ' find the comma
fname = Mid(name, intPos + 1) 'allow for comma and a space

lname = Left(name, intPos - 1)
Sheet1.Cells(x, 2) = lname
Sheet1.Cells(x, 3) = fname
x = x + 1
Loop

End Sub

Sub initials()
Dim r, c As Long
Dim erow As Long
Dim place As Long
Dim add, temp As String
Dim mystring As String
erow = Range("A" & Rows.Count).End(xlUp).Row
r = 2
c = 3
For r = 2 To erow
fname = Sheet1.Cells(r, 2)
Sheet1.Cells(r, c).Select
'looking for cells that start with &
If Left(ActiveCell.Value, 1) = "&" Then
mystring = ActiveCell.Value
'look for the first space after the letter after the &
place = InStr(3, mystring, " ")
' create a string to add to the first name
add = " " & Left(mystring, place)
'adjust the lastname field
temp = Right(mystring, Len(mystring) - place)
ActiveCell.Value = temp
'add the string to the first name
fname = fname & add
'assign the new first name to the fist name field
Sheet1.Cells(r, 2) = fname
End If


Next r

End Sub