VBA code to add a line immediately before a footer.
I want to add a line, lh margin to rh margin, immediately before the footer. Can someone help me, please, with the VBA code to do this. This is my VBA code to add a footer to a worksheet.
Sub AddFooter()
Dim Response As Integer
Application.ScreenUpdating = False
With ActiveSheet.PageSetup
.LeftFooter = "&8&F"
.CenterFooter = "&8&A"
Response = MsgBox("Do you want to maintain today's date as static ? ", vbYesNo _
+ vbQuestion)
If Response = vbYes Then
.RightFooter = "&8 " & Format(Now, "dd/mm/yy")
Else
.RightFooter = "&8" & "&D"
End If
End With
Application.ScreenUpdating = True
End Sub
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago