Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 774
- Office Version
- 365
- 2019
- Platform
- Windows
Good evening,
I had help in earlier with a code and it works terrific. However I have a date and time code I also use for the footer. I'm hoping I can have both of these with the name right above the date and time.
The codes work brilliant on there own, I just need to either combine them or have another statement in the 2nd macro.
Thank you,
I want this date and time to appear right below the name.
I had help in earlier with a code and it works terrific. However I have a date and time code I also use for the footer. I'm hoping I can have both of these with the name right above the date and time.
The codes work brilliant on there own, I just need to either combine them or have another statement in the 2nd macro.
Thank you,
VBA Code:
Sub user()
Dim wName As String, wSurname As String, Title As String
Dim x As Variant
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
With ActiveSheet.PageSetup
. LeftFooter = "SUBMITTED BY: " & Title & wSurname
End With
I want this date and time to appear right below the name.
VBA Code:
Sub Date_Time()
ActiveSheet.PageSetup.LeftFooter = "&12&""Times New Roman""" & Format(Now, "DD MMM YY hh:mm")
End Sub