ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programming footer (https://www.excelbanter.com/excel-programming/315166-programming-footer.html)

Donald[_4_]

Programming footer
 
The following code will programmatically add the user's name as well as date
and time to the right footer as well as setting the fonts of both lines in
the footer.

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14" & Application.UserName & _
Chr(10) & "&""Times New Roman""&8" & "&D &T"

How do I get it to underline the user name? (only the user name)

--
D.S.



Frank Kabel

Programming footer
 
Hi
AFAIK you can't achieve this as you can set the font style only for the
complete fotter text

"Donald" wrote:

The following code will programmatically add the user's name as well as date
and time to the right footer as well as setting the fonts of both lines in
the footer.

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14" & Application.UserName & _
Chr(10) & "&""Times New Roman""&8" & "&D &T"

How do I get it to underline the user name? (only the user name)

--
D.S.




Dave Peterson[_3_]

Programming footer
 
If you record a macro when you do this manually, you'll see that &U turns on/off
underlining. Just select your charactersto underline, then hit the A icon and
format those characters like you want:

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14&U" & Application.UserName & _
Chr(10) & "&U&""Times New Roman""&8" & "&D &T"

Donald wrote:

The following code will programmatically add the user's name as well as date
and time to the right footer as well as setting the fonts of both lines in
the footer.

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14" & Application.UserName & _
Chr(10) & "&""Times New Roman""&8" & "&D &T"

How do I get it to underline the user name? (only the user name)

--
D.S.


--

Dave Peterson


Donald Stockton

Programming footer
 
Whoops, this actually seems to underline ALL of my footer

D.S.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Dave Peterson[_3_]

Programming footer
 
The code I posted worked nicely for me (xl2002).

Can you post your code--and what is returned by application.username?



Donald Stockton wrote:

Whoops, this actually seems to underline ALL of my footer

D.S.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson


Donald[_4_]

Programming footer
 
Great! Was wondering if there was a way to turn it off. Just ask Dave, when
he's feeling ten feet tall.

--
Donald
"Dave Peterson" wrote in message
...
Try this version with the extra U:

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14&U" & Application.UserName & _
Chr(10) & "&U&""Times New Roman""&8" & "&D &T"


One &U turns on the underlining. One &U turns off the underlining. Just
like
Grace Slick wrote (or something like that!)

(Sometimes, I'm too subtle for my own good.)

Donald wrote:

BTW, I'm running OfficeXP (Excel ver 10.0)

--
Donald
"Donald" wrote in message
...
No U after char(10), the code I posted actually was copied and pasted.
Only one 'U' in the code.

--
Donald
"Dave Peterson" wrote in message
...
Can you find the difference:

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14&U" & Application.UserName & _
Chr(10) & "&U&""Times New Roman""&8" & "&D &T"

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14&U" & Application.UserName & _
Chr(10) & "&""Times New Roman""&8" & "&D &T"

(look for an extra &U after the chr(10) portion.)

(Sometimes copying and pasting from the newsgroup post is a good
thing.
<vbg.)



Donald wrote:

My code is as follows:
ActiveSheet.PageSetup.RightFooter = "&""Brush Script
mt,italic""&14&U" &
Application.UserName & Chr(10) & "&""Times New Roman""&8" & "&D &T"

my network login "J_Doe" is returned by <application.username

The problem right now is that all of the footer is underlined, not
the
username only.

--
Donald

"Dave Peterson" wrote in message
...
The code I posted worked nicely for me (xl2002).

Can you post your code--and what is returned by
application.username?



Donald Stockton wrote:

Whoops, this actually seems to underline ALL of my footer

D.S.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

--

Dave Peterson


--

Dave Peterson




--

Dave Peterson




jose luis

Programming footer
 

Hi All,

How could i catch the result of a MsgBox and derive actions from th
user decision? Any help welcome!.

Thanks in advance

jose luis

P.D. Here is what i though will do the trick. I was wrong. :(


GuardarAntes()
MsgBox "Save Changes?", vbYesNoCancel, "Save?"

If VbMsgBoxResult.vbYes = 6 Then
MsgBox "Yes"
End If
If VbMsgBoxResult.vbNo = 7 Then
MsgBox "No"
End If
End Su

--
jose lui
-----------------------------------------------------------------------
jose luis's Profile: http://www.excelforum.com/member.php...fo&userid=1331
View this thread: http://www.excelforum.com/showthread.php?threadid=27350


Myrna Larson

Programming footer
 
Have you tried the documentation for Msgbox? It gives an example...

On Sun, 31 Oct 2004 00:53:45 -0500, jose luis
wrote:


Hi All,

How could i catch the result of a MsgBox and derive actions from the
user decision? Any help welcome!.

Thanks in advance

jose luis

P.D. Here is what i though will do the trick. I was wrong. :(


GuardarAntes()
MsgBox "Save Changes?", vbYesNoCancel, "Save?"

If VbMsgBoxResult.vbYes = 6 Then
MsgBox "Yes"
End If
If VbMsgBoxResult.vbNo = 7 Then
MsgBox "No"
End If
End Sub



Dave Peterson[_3_]

Programming footer
 
Excellent response!!!



Donald wrote:

Great! Was wondering if there was a way to turn it off. Just ask Dave, when
he's feeling ten feet tall.

--
Donald
"Dave Peterson" wrote in message
...
Try this version with the extra U:

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14&U" & Application.UserName & _
Chr(10) & "&U&""Times New Roman""&8" & "&D &T"


One &U turns on the underlining. One &U turns off the underlining. Just
like
Grace Slick wrote (or something like that!)

(Sometimes, I'm too subtle for my own good.)

Donald wrote:

BTW, I'm running OfficeXP (Excel ver 10.0)

--
Donald
"Donald" wrote in message
...
No U after char(10), the code I posted actually was copied and pasted.
Only one 'U' in the code.

--
Donald
"Dave Peterson" wrote in message
...
Can you find the difference:

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14&U" & Application.UserName & _
Chr(10) & "&U&""Times New Roman""&8" & "&D &T"

ActiveSheet.PageSetup.RightFooter = _
"&""Brush Script mt,italic""&14&U" & Application.UserName & _
Chr(10) & "&""Times New Roman""&8" & "&D &T"

(look for an extra &U after the chr(10) portion.)

(Sometimes copying and pasting from the newsgroup post is a good
thing.
<vbg.)



Donald wrote:

My code is as follows:
ActiveSheet.PageSetup.RightFooter = "&""Brush Script
mt,italic""&14&U" &
Application.UserName & Chr(10) & "&""Times New Roman""&8" & "&D &T"

my network login "J_Doe" is returned by <application.username

The problem right now is that all of the footer is underlined, not
the
username only.

--
Donald

"Dave Peterson" wrote in message
...
The code I posted worked nicely for me (xl2002).

Can you post your code--and what is returned by
application.username?



Donald Stockton wrote:

Whoops, this actually seems to underline ALL of my footer

D.S.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

--

Dave Peterson


--

Dave Peterson




--

Dave Peterson


--

Dave Peterson



All times are GMT +1. The time now is 07:20 PM.

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