LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Chip Pearson
 
Posts: n/a
Default

Press ALT+F11 to open the VBA Editor, the press CTRL+R to view
the Project Explorer. This will display a tree view window on the
left side of the VBA screen. Find your workbook in the tree
view, expand that node, and expand the "Microsoft Excel Objects"
node. Double click the ThisWorkbook to open that code module. In
that code module, paste the following code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.CenterHeader = "This file was prepared by "
& _
Environ("username") & " on &D at &T"
End Sub

Close the VBA Editor from the File menu. This code will execute
automatically when you print the workbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Brian Allen - McKEOWN INC." <Brian Allen - McKEOWN
wrote in message
...
Chip,

Thanks for the info, but copying and pasting that didn't
work..as I didn't
think it would. I don't have any VBA background and I'm
presuming that it is
VBA.

Any other ideas or how can I make this work with my little
programming
knowledge?

Thanks again!

"Chip Pearson" wrote:

Brian,

Try something like

ActiveSheet.PageSetup.CenterFooter = "This file was prepared
by "
& _
Environ("username") & " on &D at &T"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Brian Allen - McKEOWN INC." <Brian Allen - McKEOWN
wrote in message
...
I'm trying to put the user name in a footer and can't figure
it
out.

I want "This file was prepared by 'username' on &[Date} at
&[Time].". But I
can't get the username in there. I've tried everything I
can
think of from
system variables to system variables with an & and things
that
just shouldn't
work (and didn't).

Any help would be greatly appreciated.








 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Footer - Ajit Ajit Munj Excel Discussion (Misc queries) 2 March 11th 05 02:39 PM
Excel user management CTE Excel Discussion (Misc queries) 1 February 22nd 05 12:12 PM
Formatting a footer with a top border-line Ed Isenberg Excel Discussion (Misc queries) 3 December 19th 04 10:41 PM
File is locked for Editing by user problem Mirth Excel Discussion (Misc queries) 1 December 3rd 04 04:45 PM
find and match the max buffyslay Excel Worksheet Functions 0 November 2nd 04 01:57 PM


All times are GMT +1. The time now is 01:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"