Rycliff
Rycliff

Reputation: 127

Excel VBA change footer font and font size

The following Excel VBA code automatically changes the footer when a cell value changes, but Excel also changes the font and size. I am trying to keep the font Arial and font size 10. How do I do that? Thanks!

Private Sub Worksheet_Change(ByVal Target As Range)
    On Error Resume Next
    If Target.Address = "$E$4" Then
        ActiveSheet.PageSetup.LeftFooter = Range("$G$4").Value
    End If
End Sub

Upvotes: 3

Views: 5225

Answers (1)

Алексей Р
Алексей Р

Reputation: 7627

Try this:

ActiveSheet.PageSetup.LeftFooter = "&""Arial""&10" & Range("$G$4").Value

Upvotes: 4

Related Questions