Footer Settings in an Excel Sheet

  • Thread starter Hidayathulla Abdul Jabbar
  • Start date
H

Hidayathulla Abdul Jabbar

Hi,

I am setting up the footer to an Excel page through VBA
Script but sometime, the left footer is not starting from
the extreme left (i.e., it leaves some spaces and seems
like started from the column B). The following script
used to set up the footer.

Range("A3:M101").Select
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = analyst
.CenterFooter = filename
.RightFooter = mydate
.LeftMargin = Application.InchesToPoints
(0.236220472440945)
.RightMargin = Application.InchesToPoints
(0.275590551181102)
.TopMargin = Application.InchesToPoints
(0.236220472440945)
.BottomMargin = Application.InchesToPoints
(0.354330708661417)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1

Could you suggest a solution for the same.

Regards
Hidayath
 
D

Dave Peterson

A couple of not too helpful questions?

Are you sure that the stuff in the left foolder (analyst) doesn't have leading
spaces?

Are your margins ok?

When I record a macro to setup page settings, I'll remove everything that I know
I don't care about. (Leave the user/printer's default alone.)

You may want to try taking the same approach (remove the lines you didn't mean
to change) and see if that helps.

(As far as I know, the margins in the headers/footers are not dependent on the
columns in the "data" portion.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Printing Macro 6
Formula in Header 2
Macro help: File path in Excel 2000 2
Header and Footer Macro 1
Print area - selection 4
Auto populate dates 2
Optimize Beginner's Code 1
Worksheet(1).PageSetup 1

Top