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 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago