Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 774
- Office Version
- 365
- 2019
- Platform
- Windows
Hello I have the following Micro and it works find for placing a truncated user name a little after the last entry in Column A. What I am hoping to do is have the truncated user name be placed in the left footer.
This is the micro that I currently have and it works, because it's been done hundreds of times. My new project requires it to be placed in the footer. I hope someone may be able to help me out. I'm know the range line we need to be adjusted.
This is the micro that I currently have and it works, because it's been done hundreds of times. My new project requires it to be placed in the footer. I hope someone may be able to help me out. I'm know the range line we need to be adjusted.
VBA Code:
Sub USER_NAME()
Dim LastRow As Long
Dim wName As String, wSurame As String, Title As String
Dim x As Variant
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
wName = Replace(Application.UserName, "Esq", "MR")
wSurname = UCase(Split(wName, ",")(0))
For Each x In Array("MR ", "MS")
If InStr(wName, x) > 0 Then
Title = UCase(x)
Exit For
End If
Next x
Range("A" & LastRow + 3).Value = "SUBMITTED BY: " & Title & wSurname
End Sub