![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Paul
Posts: 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 |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
ActiveSheet.PageSetup.CenterFooter = "&""Arial,Bold""YourText"
__________________
Kind regards, Al Chara |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Location: Paul
Posts: 34
|
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 |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Not sure, maybe someone else knows.
|
|
|
|
|
|
#5 | |
|
Board Regular
Join Date: Feb 2002
Posts: 74
|
Quote:
ActiveSheet.PageSetup.CenterFooter = "&""Arial,Bold""" & Range("A1")
__________________
"Interfere? Of course we should interfere! Always do what you're best at, that's what I say!" -- The Doctor, Nightmare of Eden |
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,064
|
hi
Can i ask can anyoner add to this code so poss different colo(u)rs???
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
as follows; &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 |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|