Cell Reference in a Footer


Posted by Steve on January 26, 2002 10:37 AM

How do I reference a cells contents in a footer?

Posted by Tom Urtis on January 26, 2002 10:42 AM

You'd need a VBA line of code, something like this:

ActiveSheet.PageSetup.RightFooter = [a1].Value


Tom Urtis



Posted by Jack in the UK on January 26, 2002 10:53 AM

Hi -

My opinion would be to have some code formula wont do this.

Set the cell value to footer.(left or right)
Here s some code i have to allow edit as needed remember to set cells to value and in square brackets ie as i have to [E1].Value
Some code just copt to module and paste in / assign a buttonansd run. edit as needed

Sub JackFoot()
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = [E1].Value
.RightFooter = "Page &P"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = Array(204, 196)
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
End Sub


HTH
Jack in the UK