ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Underline portion of footer with VBA (https://www.excelbanter.com/excel-discussion-misc-queries/108667-underline-portion-footer-vba.html)

LandesMD

Underline portion of footer with VBA
 
I would like to have a user enter their name and then display "Modified by:
[Name]" and have the name portion underlined. I know how to use VBA to enter
the footer, but how do I underline a portion of it?

Thanks
LandesMD

Andy Pope

Underline portion of footer with VBA
 
Hi,

Use &U to get underlining toggled on and off.

Modified by: &U[Name]&U

And here from the help file are the other formatting codes.
Format code Description
&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.
&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.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified font. Be
sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size. Use a
two-digit number to specify a size in points.
&N Prints the total number of pages in the document.

Cheers
Andy

LandesMD wrote:
I would like to have a user enter their name and then display "Modified by:
[Name]" and have the name portion underlined. I know how to use VBA to enter
the footer, but how do I underline a portion of it?

Thanks
LandesMD


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

LandesMD

Underline portion of footer with VBA
 
Thanks a million!! That's exactly what I was looking for, I also wanted to
bold the font, now I know how "and knowing is half the battle"!

LandesMD

"Andy Pope" wrote:

Hi,

Use &U to get underlining toggled on and off.

Modified by: &U[Name]&U

And here from the help file are the other formatting codes.
Format code Description
&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.
&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.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified font. Be
sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size. Use a
two-digit number to specify a size in points.
&N Prints the total number of pages in the document.

Cheers
Andy

LandesMD wrote:
I would like to have a user enter their name and then display "Modified by:
[Name]" and have the name portion underlined. I know how to use VBA to enter
the footer, but how do I underline a portion of it?

Thanks
LandesMD


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


LandesMD

Underline portion of footer with VBA
 
One further thing. Is there any way to get a character return in the footer
using VBA??? Or enter a second line of text??

"LandesMD" wrote:

Thanks a million!! That's exactly what I was looking for, I also wanted to
bold the font, now I know how "and knowing is half the battle"!

LandesMD

"Andy Pope" wrote:

Hi,

Use &U to get underlining toggled on and off.

Modified by: &U[Name]&U

And here from the help file are the other formatting codes.
Format code Description
&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.
&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.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified font. Be
sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size. Use a
two-digit number to specify a size in points.
&N Prints the total number of pages in the document.

Cheers
Andy

LandesMD wrote:
I would like to have a user enter their name and then display "Modified by:
[Name]" and have the name portion underlined. I know how to use VBA to enter
the footer, but how do I underline a portion of it?

Thanks
LandesMD


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


Andy Pope

Underline portion of footer with VBA
 
activesheet.pagesetup.centerfooter = "Hello" & vblf & "Today"


LandesMD wrote:
One further thing. Is there any way to get a character return in the footer
using VBA??? Or enter a second line of text??

"LandesMD" wrote:


Thanks a million!! That's exactly what I was looking for, I also wanted to
bold the font, now I know how "and knowing is half the battle"!

LandesMD

"Andy Pope" wrote:


Hi,

Use &U to get underlining toggled on and off.

Modified by: &U[Name]&U

And here from the help file are the other formatting codes.
Format code Description
&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.
&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.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified font. Be
sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size. Use a
two-digit number to specify a size in points.
&N Prints the total number of pages in the document.

Cheers
Andy

LandesMD wrote:

I would like to have a user enter their name and then display "Modified by:
[Name]" and have the name portion underlined. I know how to use VBA to enter
the footer, but how do I underline a portion of it?

Thanks
LandesMD

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

LandesMD

Underline portion of footer with VBA
 
Perfect, I would never have found that! From the help file it looks as
though that could be useful elseware...

Thanks
LandesMD

"Andy Pope" wrote:

activesheet.pagesetup.centerfooter = "Hello" & vblf & "Today"


LandesMD wrote:
One further thing. Is there any way to get a character return in the footer
using VBA??? Or enter a second line of text??

"LandesMD" wrote:

etc...

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info



All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com