Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Duke Carey
 
Posts: n/a
Default

Bob Phillips posted this just a little bit ago in the Excel General Questions
NG. It applies to setting a print footer, but you can look at the
application object's events and try to find one that would work for you.
There's a NewWorkbook event and several others that might make sense
------------------------------------------------------------------------------------------
You could try this. Add this code to Personal.xls, and it will then
automatically set the footer for any sheet in any workbook.

Private WithEvents app As Application

Private Sub app_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As Boolean)
With Wb.ActiveSheet
.PageSetup.LeftFooter = "&""Arial,Bold""&8" & Wb.FullName
End With
End Sub

Private Sub Workbook_Open()
Set app = Application
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

-------------------------------------------------------------------------------------------
"Danny" wrote:

The macro (change the pointer color) is in my personal workbook but it
doesn't run when I open a new workbook. Of course my personal workbook opens
(hidden) when I open a workbook. I tried what you said but it doesn't work
either. Help!

"Duke Carey" wrote:

Why would you want it in every workbook and not in your Personal.xls file?
If you put it there, it's available any/everytime you run Excel.

If you really want it in every workbook you create, svae it in BOOK.XLT in
the

C:\Documents and Settings\user_name\Application Data\Microsoft\Excel\XLSTART

directory

"Danny" wrote:

I wrote a simple macro and I'd like that macro to be included in every
workbook that I open.

I tried but failed to locate the template to launch a new workbook.

Please help. Thank you.

Reply
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
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
How do I find a file/spreadsheet that Excel says is Already open but I can't find it? nwtrader8 Excel Discussion (Misc queries) 5 June 21st 05 02:16 PM
Macro - Open Word with Excel macro Bill Excel Discussion (Misc queries) 3 May 23rd 05 11:21 PM
Open Access Database under and Excel window using a Macro BMSpell Excel Worksheet Functions 1 January 8th 05 05:32 PM
Macro in Excel 2002 to save a workbook to a FTP location Lloyd Excel Discussion (Misc queries) 0 December 21st 04 02:49 PM


All times are GMT +1. The time now is 06:02 PM.

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"