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 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago