Invalid qualifier error

rjplante

Well-known Member
Joined
Oct 31, 2008
Messages
574
Office Version
  1. 365
Platform
  1. Windows
I have the code posted below and when it runs, it flags with and Invalid Qualifier error. I don't know why it is doing so. It highlights the title of the macro in yellow, and has the Ftr in the With statement also highlighted selected. Any ideas would be great.

Thanks,

Robert

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Dim Ftr As String
    
    ActiveSheet.PageSetup.RightFooter = "Machine:  " & Sheets("Safety").Range("M1").Value
    
    Ftr = ActiveSheet.PageSetup.RightFooter.Text
    
    With Ftr.Font
        .Name = "Calibri"
        .FontStyle = "Bold"
        .Size = 18
    End With
        
End Sub
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try this

Code:
    Dim Ftr As String
    Ftr = "Machine:  " & Sheets("Safety").Range("M1").Value
    ActiveSheet.PageSetup.RightFooter = "&""Calibri,Bold""&18" & Ftr

You could have recorded a macro to learn this method :)
 
Upvote 0

Forum statistics

Threads
1,225,741
Messages
6,186,763
Members
453,370
Latest member
juliewar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top