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

Thanks Jim. My error. I used the first procedure and it works great.
--
maryj


"Jim Cone" wrote:

maryj,
Not sure I understand what is going on.
Either one of the subs should work for both worksheets and chart sheets.
They are independent, choose one or the other.

Jim Cone
San Francisco, USA


"maryj" wrote in message
...
Thanks Jim. The workbook will have sheets with both data and charts and would
like to have one macro to enter the footer for all sheets at once. Tried
combining the 2 procedures into 1 but still got the "type mismatch" error.
Can the 2 be combined?
--
maryj


"Jim Cone" wrote:
maryj,
A chart sheet is not a worksheet, so you have to use a variable
data type that includes both. Object does that.
"--------------------------------------------
Public Sub PathAndFileNameInFooter()
Dim objSht As Object
For Each objSht In ActiveWindow.SelectedSheets
objSht.PageSetup.LeftFooter = ActiveWorkbook.FullName"
Next 'objSht
Set objSht = Nothing
End Sub
'-------------------------------------------
or this
'------------------------------------------
Public Sub PathAndFileNameInFooter2()
Dim lngCount As Long
For lngCount = 1 To ActiveWindow.SelectedSheets.Count
Sheets(lngCount).PageSetup.LeftFooter = ActiveWorkbook.FullName
Next 'lngCount
End Sub
'-----------------------------------------
Jim Cone
San Francisco, USA



"maryj" wrote in message
...
Using Win 2K/Office 2K. Added this code to Personal.xls to create footer for
each worksheet in workbook with file name and path.
Public Sub PathAndFileNameInFooter()
Dim wsSht As Worksheet
For Each wsSht In ActiveWindow.SelectedSheets
wsSht.PageSetup.LeftFooter = ActiveWorkbook.FullName
Next wsSht
End Sub
It works great except I get a "type mismatch" error for chart sheets. How
can I modify the code to also include chart sheets?
maryj




 
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
Header or Footer to show up on multiple sheets in a document Holly Domine Excel Worksheet Functions 1 May 23rd 05 06:17 PM
how do i change footer settings on multiple sheets at the same ti. Chris Excel Worksheet Functions 1 March 29th 05 03:05 PM
Copying multiple sheets from one book 2 another and undertake spec Pank Mehta Excel Discussion (Misc queries) 14 March 16th 05 04:41 PM
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) RICHARD Excel Worksheet Functions 1 March 15th 05 05:49 PM
Multiple sheets selected twa14 Excel Discussion (Misc queries) 2 December 21st 04 11:15 AM


All times are GMT +1. The time now is 01:12 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"