design footer

hony78

New Member
Joined
Dec 29, 2013
Messages
21
Hello,

I have a code that add a footer to an active sheet using a messege box.
I need the footer to be BOLD and font size 14, how can I do that?
(I tried to record this command, but it turn out very long and didn't work).

thanks alot
Hony


Sub footer()

Dim message, headline
message = "enter headline and company"
headline = InputBox(message)
ActiveSheet.PageSetup.CenterHeader = headline

End Sub
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi hony78 - I did not know how to do this, but I was able to record the code, remove just what I wanted, and saved the code below. It is repeatable across other worksheets that I tried it on.

Hope this helps.

Code:
Sub hony78_footer_format()
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .CenterFooter = "&""-,Bold""&KFF0000Macro Format Footer"
    End With
    Application.PrintCommunication = True
End Sub
 
Upvote 0
Hi goesr,

thank you very much for your respond.
it partly worked, the font changed (for some reason it turn out red),
but it did'nt take the messege box input, instead it display "Macro Format Footer"
I tried to
manipulate it to take the input but with no success...

hony

 
Upvote 0
Hi hony78 - The color comes from the FF0000, from the RGB hex for (255, 0, 0). Therefore, replacing FF0000 with 00FF00 would result in Green Text, etc. The display "Macro Format Footer is in the script. Just change Macro Format Footer to whatever text you want the footer to be. For it to take the input box, you would have to create a variable that is written to by the input box and them put that variable in place of the words Macro Format Footer.

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,825
Members
449,096
Latest member
Erald

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