showing date & time in footer, and resizing font.

countryfan_nt

Well-known Member
Joined
May 19, 2004
Messages
716
Hello friends, hope all is well!

please help me with the code here please. Trying to place a custom footer, with a certain font size,
but I keep getting the font size in the footer (i.e. 1228 - Aug - 2018 18:16:07)
Please help me place only the date & time in the footer.

Thanks a lot in advance.


Code:
Sub FormatDate()
    With ActiveSheet.PageSetup

datestring = Format(Now(), "DD - MMM - YYYY  HH:MM:SS")

Sheets("Physician Contract").Select
ActiveSheet.PageSetup.LeftFooter = "&""times new roman"" & 12" & datestring
  
     End With
End Sub
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

John_w

MrExcel MVP
Joined
Oct 15, 2007
Messages
6,425
Try this:
Code:
Sub CreateFooter()
    Dim dateString As String
    dateString = Format(Now, "DD - MMM - YYYY  HH:MM:SS")
    With ActiveSheet.PageSetup
        .LeftFooter = "&""Times New Roman""&12 " & dateString
        .RightFooter = ""
    End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,109,066
Messages
5,526,576
Members
409,712
Latest member
lager2020

This Week's Hot Topics

Top