Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 774
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings, I have a VBA that will insert the User's name with a title. This title & user name needs to be insert into Column G after the previous adjecent cell has data. So if data is entered into Cell F5 then the title and user name will be entered into Cell G5. This is process repeats it's everytime another entry is made in Column F. I'm fairly certain the basic formula I have works (not sure about the last couple of line). I just need it to be activated once data is entered in the previous column on the same row.
Thank you , so much
Thank you , so much
VBA Code:
Sub Insert_Sir_Name()
Dim LastRow As Long
Dim wSurame As String, Title As String
Dim x As Variant
LastRow = ActiveSheet.Cells(Rows.Count, "G").End(xlUp).Row
wSurname = UCase(Split(wName, ",")(0))
For Each x In Array("Cpt ", "Cpl ", "Mr ", "Mrs ", "Esq ", "Ms")
If InStr(wName, x) > 0 Then
Title = UCase(x)
Exit For
End If
End Sub