Make text in a cell appear in a footer

M

MichaelRLanier

Is there a way to make text that appears in a cell to appear in the
footer? If so, for example, how would I make A1 appear in the
footer? Thanking you in advance.

Michael
 
G

Gary Keramidas

adapt this to what you need, just watch for word-wrap.


Sub Print_sheet()
Dim ws As Worksheet
Dim rng As Range
Dim lastrow As Long
Set ws = Worksheets("sheet1")
lastrow = ws.Cells(Rows.Count, "I").End(xlUp).Row
Application.ScreenUpdating = False
Set rng = ws.Range("D1:R" & lastrow)

With ws
With .PageSetup
.Orientation = xlLandscape
.FooterMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.4)
.LeftMargin = Application.InchesToPoints(0.4)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.45)
.PrintArea = rng.Address
.HeaderMargin = Application.InchesToPoints(0.25)
.RightFooter = ".Range("A1")
.FitToPagesWide = 1
.CenterHorizontally = True
End With
.PrintPreview
End With
Application.ScreenUpdating = True
End Sub
 
R

ryguy7272

I think you need to use code:
Sub Begin()
ActiveSheet.PageSetup.LeftHeader = _
Format(Worksheets("Sheet1").Range("B5").Value)
End Sub

From here:
http://www.cpearson.com/excel/headfoot.htm

BTW, that is a great resource. If you really want to learn Excel, you
shoudl try to get acquainted with the cpearson stuff!!

Regards,
Ryan--
 

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

Top