Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Common footer but not common margins please -(Page 1 of 2) etc

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Common footer but not common margins please -(Page 1 of 2) etc

When you have selected ALL SHEETS margins are bound to change to the same
setting for all of them along with header and footer.

You can first set header and footer and then set margins.

Or try to record a macro while setting header and footer, edit it to remove
anything other than setting of header and footer and run it when needed
"RajenRajput1" wrote:

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Common footer but not common margins please -(Page 1 of 2) etc

With record Macro you will get something like the following;
(remove anything which you don't want. to get to the code choose Macros and
Edit)
Sub Macro1()
'
' Macro1 Macro
'

'
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Page &P of &N"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
End Sub


"RajenRajput1" wrote:

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Common footer but not common margins please -(Page 1 of 2) etc

Thank you for your help on this.

So I cannot do the task (as simple as it seems) without the help of VB/ macro?

What is the code for VB to detect the total number of worksheets in the
workbook? With this code, I may be able to compile something more adaptable.


In a way, I am glad I wasn't silly enough to overlook anything. On the
otherhand, it's one of those things that people expect to be a feature in an
expensive software package. Imagine the people who compile a workbook with
dozens of sheets and pages, and then margin them all up how they want it,
then put a common footer, and bang, all the alignment is off - and there is
no undo for this.


Thank you, kind regards.


"Sheeloo" wrote:

With record Macro you will get something like the following;
(remove anything which you don't want. to get to the code choose Macros and
Edit)
Sub Macro1()
'
' Macro1 Macro
'

'
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Page &P of &N"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
End Sub


"RajenRajput1" wrote:

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Common footer but not common margins please -(Page 1 of 2) etc

You are overlooking the fact that grouped sheets take on the print
properties of the active sheet.

I would run this macro to set just the common footer and not upset the other
print properties.

Sub Path_All_Sheets()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = ActiveWorkbook.FullName & " " & Chr(13) _
& Application.UserName & " " & Date
Next
End Sub

Adjust to suit your custom footer.


Gord Dibben MS Excel MVP

On Tue, 26 Aug 2008 07:47:00 -0700, RajenRajput1
wrote:

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Common footer but not common margins please -(Page 1 of 2) etc

Sheeloo,

Thank you, but I couldn't get it to work.

I tried the code you gave, and upon running the macro, testing it, it only
does one worksheet.

I tried to generate the code myself, the same thing as yours appeared, but
it did not work on re-run.

Any thoughts ?


"Sheeloo" wrote:

With record Macro you will get something like the following;
(remove anything which you don't want. to get to the code choose Macros and
Edit)
Sub Macro1()
'
' Macro1 Macro
'

'
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Page &P of &N"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
End Sub


"RajenRajput1" wrote:

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Common footer but not common margins please -(Page 1 of 2) etc

Apparently MS has not separated the header/footer settings with margins...

Try ASAP Utilities. It may have a function which you want.

The number of worksheets that a Worksheets or a Sheets collection contains
is represented by the Count property. Based on this, Worksheets.Count or
Sheets.Count can give you the number of worksheets in the current workbook.

You will have to loop through the sheets to set the desired options.

I will try to give you the complete code sometime later today.

"RajenRajput1" wrote:

Thank you for your help on this.

So I cannot do the task (as simple as it seems) without the help of VB/ macro?

What is the code for VB to detect the total number of worksheets in the
workbook? With this code, I may be able to compile something more adaptable.


In a way, I am glad I wasn't silly enough to overlook anything. On the
otherhand, it's one of those things that people expect to be a feature in an
expensive software package. Imagine the people who compile a workbook with
dozens of sheets and pages, and then margin them all up how they want it,
then put a common footer, and bang, all the alignment is off - and there is
no undo for this.


Thank you, kind regards.


"Sheeloo" wrote:

With record Macro you will get something like the following;
(remove anything which you don't want. to get to the code choose Macros and
Edit)
Sub Macro1()
'
' Macro1 Macro
'

'
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Page &P of &N"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
End Sub


"RajenRajput1" wrote:

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Common footer but not common margins please -(Page 1 of 2) etc

Thank you again. The code will be useful for the future.



"Sheeloo" wrote:

Apparently MS has not separated the header/footer settings with margins...

Try ASAP Utilities. It may have a function which you want.

The number of worksheets that a Worksheets or a Sheets collection contains
is represented by the Count property. Based on this, Worksheets.Count or
Sheets.Count can give you the number of worksheets in the current workbook.

You will have to loop through the sheets to set the desired options.

I will try to give you the complete code sometime later today.

"RajenRajput1" wrote:

Thank you for your help on this.

So I cannot do the task (as simple as it seems) without the help of VB/ macro?

What is the code for VB to detect the total number of worksheets in the
workbook? With this code, I may be able to compile something more adaptable.


In a way, I am glad I wasn't silly enough to overlook anything. On the
otherhand, it's one of those things that people expect to be a feature in an
expensive software package. Imagine the people who compile a workbook with
dozens of sheets and pages, and then margin them all up how they want it,
then put a common footer, and bang, all the alignment is off - and there is
no undo for this.


Thank you, kind regards.


"Sheeloo" wrote:

With record Macro you will get something like the following;
(remove anything which you don't want. to get to the code choose Macros and
Edit)
Sub Macro1()
'
' Macro1 Macro
'

'
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Page &P of &N"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
End Sub


"RajenRajput1" wrote:

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Common footer but not common margins please -(Page 1 of 2) etc

All hail the Gord !

Thank you.

"Gord Dibben" wrote:

You are overlooking the fact that grouped sheets take on the print
properties of the active sheet.

I would run this macro to set just the common footer and not upset the other
print properties.

Sub Path_All_Sheets()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = ActiveWorkbook.FullName & " " & Chr(13) _
& Application.UserName & " " & Date
Next
End Sub

Adjust to suit your custom footer.


Gord Dibben MS Excel MVP

On Tue, 26 Aug 2008 07:47:00 -0700, RajenRajput1
wrote:

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Common footer but not common margins please -(Page 1 of 2) etc

I assume that means you can use the macro.

Thanks for the feedback.


Gord

On Tue, 26 Aug 2008 09:30:01 -0700, RajenRajput1
wrote:

All hail the Gord !

Thank you.

"Gord Dibben" wrote:

You are overlooking the fact that grouped sheets take on the print
properties of the active sheet.

I would run this macro to set just the common footer and not upset the other
print properties.

Sub Path_All_Sheets()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = ActiveWorkbook.FullName & " " & Chr(13) _
& Application.UserName & " " & Date
Next
End Sub

Adjust to suit your custom footer.


Gord Dibben MS Excel MVP

On Tue, 26 Aug 2008 07:47:00 -0700, RajenRajput1
wrote:

Hi.

I'm a little hacked off. :o) (In a nice way)

Using Excel 2007.

My margins keep resetting after putting in footers for the whole workbook in
one go.

Say sheet 1 has a margin of 1 inch from the top.

Say sheet 2 has margin 5 inch from the top.

When I select all sheets, and then add a footer like "Page &[Page] of
&[Pages]", then do print preview, the footers are correct, but the margins
change to be the same common size as the original sheet where I did the
changes.

What am I overlooking here? I only want to make a common footer, not a
common margin or page layout.

Any help would be appreciated, and I will give further info if necc.

Thank you very much.




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
Second Most Common Value Skalp Excel Discussion (Misc queries) 6 May 9th 23 07:43 PM
Common header/footer in Excel James Excel Discussion (Misc queries) 4 April 17th 07 08:36 PM
common log trendline Greg Excel Discussion (Misc queries) 1 March 18th 06 09:07 PM
most common number Jeff New Users to Excel 1 February 16th 06 09:02 AM
Common spacing RAJEEV CHADHA Excel Worksheet Functions 0 April 26th 05 01:29 PM


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

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"