Make the Header/Footer bold

paulyf

New Member
Joined
Mar 27, 2002
Messages
34
Hi All

Thanks to Dave Hawley for previous code. I now have the following but would like to embolden the text in the header/footer:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address = "$A$1" Then
ActiveSheet.PageSetup.CenterFooter = Range("A1")

As a complete novice, the Microsoft VB Help File does not seem overly helpful. I have managed to glean that &B should turn bold on but where in the code does it go????

Ta very much

Cheers - Paul
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Thanks Al,

The only problem is that I have used a cell reference rather than actual text to be displayed in the footer. It doesn't like the following code:

ActiveSheet.PageSetup.CenterFooter = Range("&""Arial,Bold""A1")

Any Thoughts???

Cheers - Paul
 
Upvote 0
On 2002-04-09 08:23, paulyf wrote:
Thanks Al,

The only problem is that I have used a cell reference rather than actual text to be displayed in the footer. It doesn't like the following code:

ActiveSheet.PageSetup.CenterFooter = Range("&""Arial,Bold""A1")

Any Thoughts???

Cheers - Paul

Try this syntax:
ActiveSheet.PageSetup.CenterFooter = "&""Arial,Bold""" & Range("A1")
 
Upvote 0
On 2002-04-13 06:31, Jack in the UK wrote:
hi

Can i ask can anyoner add to this code so poss different colo(u)rs???

Hi jack...the colouring formats cannot be used for headers..... formats avail are
as follows;

<pre/>
&L Left-aligns the characters that follow.
&C Centers the characters that follow.
&R Right-aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&"fontname" Prints the characters that follow in the specified
font. Be sure to include the quotation marks around
the font name.
&nn Prints the characters that follow in the specified
font size. Use a two-digit number to specify a size
in points.
Codes to insert specific data
-------------------------------------------------------------------
&D Prints the current date
&T Prints the current time
&F Prints the name of the document
&A Prints the name of the workbook tab (the "sheet name")
&P Prints the page number
&P+number Prints the page number plus number
&P-number Prints the page number minus number
&& Prints a single ampersand
&N Prints the total number of pages in the document

</pre>
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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