Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
mge mge is offline
external usenet poster
 
Posts: 8
Default Can you create a dynamic footer in Excel?

I would like to include a footer that reads from the sheet being printed.
Does anyone know of a practical way to do this?
--
mgelde
  #2   Report Post  
Posted to microsoft.public.excel.misc
mge mge is offline
external usenet poster
 
Posts: 8
Default Can you create a dynamic footer in Excel?

I was able to come up with code that does this. See Below:

This code goes in the VBAProject Workbook section

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim Wks As Worksheet
Dim stFullFileName As String
Dim stCompanyName As String

stCompanyName = Worksheets("Sheet1").Range("G19").Value
stFullFileName = ThisWorkbook.FullName
For Each Wks In ThisWorkbook.Worksheets
With Wks.PageSetup
.LeftFooter = stCompanyName
.CenterFooter = ""
.RightFooter = ""
End With
Next Wks

End Sub




--
mgelde


"mge" wrote:

I would like to include a footer that reads from the sheet being printed.
Does anyone know of a practical way to do this?
--
mgelde

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
Can't Excel create dynamic web pages any more? LilyMudd Excel Discussion (Misc queries) 1 November 5th 08 04:51 PM
Create header/footer txt file and link to Excel worksheets marc Excel Discussion (Misc queries) 0 January 24th 08 09:15 PM
How do you create a complex footer (e.g. title block) in Excel? Yrrag Excel Discussion (Misc queries) 2 November 14th 07 04:24 PM
Create capability to Paste Text into an Excel Footer MikeK Excel Discussion (Misc queries) 1 December 8th 05 04:14 PM
Create a custom footer for all Excel worksheets at one time... bigcat Excel Discussion (Misc queries) 2 March 31st 05 12:15 AM


All times are GMT +1. The time now is 08:03 PM.

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

About Us

"It's about Microsoft Excel"