Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Can I link a cell's contents to the header or footer in Excel?

I'm trying to set up spreadsheets where the footer changes depending on
certain cells contents. Has anyone been able to do that?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Can I link a cell's contents to the header or footer in Excel?

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn
wrote:

I'm trying to set up spreadsheets where the footer changes depending on
certain cells contents. Has anyone been able to do that?

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Can I link a cell's contents to the header or footer in Excel?

Try this tiny macro. It sets the center footer to the value in cell A1:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.CenterFooter = Range("A1").Value
End Sub

This macro should be pasted in workbook code, not a standard module.
--
Gary's Student


"djoslyn" wrote:

I'm trying to set up spreadsheets where the footer changes depending on
certain cells contents. Has anyone been able to do that?

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Can I link a cell's contents to the header or footer in Excel?

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn
wrote:

I'm trying to set up spreadsheets where the footer changes depending on
certain cells contents. Has anyone been able to do that?

Thanks.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Can I link a cell's contents to the header or footer in Excel?

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn
wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn
wrote:

I'm trying to set up spreadsheets where the footer changes depending on
certain cells contents. Has anyone been able to do that?

Thanks.






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Can I link a cell's contents to the header or footer in Excel?

Gord,

I'm trying to do basically the same thing but when I used this version of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy if I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want to
print this particular footer on... does using the BeforePrint event here
mean that I need to do that for each worksheet - specify the sheet and the
text in the VBE editor?

Thanks,

Steve E


"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn
wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn
wrote:

I'm trying to set up spreadsheets where the footer changes depending on
certain cells contents. Has anyone been able to do that?

Thanks.




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Can I link a cell's contents to the header or footer in Excel?

You code worked for me when placed in a *workbook* module
I changed line 3 to .PageSetup.CenterFooter = .Range("D59")
That is, I removed .TEXT
Any help?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Steve E" wrote in message
...
Gord,

I'm trying to do basically the same thing but when I used this version of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy if
I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want to
print this particular footer on... does using the BeforePrint event here
mean that I need to do that for each worksheet - specify the sheet and the
text in the VBE editor?

Thanks,

Steve E


"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn

wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select
the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn

wrote:

I'm trying to set up spreadsheets where the footer changes depending
on
certain cells contents. Has anyone been able to do that?

Thanks.






  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Can I link a cell's contents to the header or footer in Excel?

Well... not really. Still get the same error.

I have this in the *workbook* module [right click on the excel icon in
menubar and 'view code'...]

Does it matter how the cell I'm referencing is formatted? [General] or how
many characters are in that field? [742]

??

Thanks in advance!

Steve
"Bernard Liengme" wrote:

You code worked for me when placed in a *workbook* module
I changed line 3 to .PageSetup.CenterFooter = .Range("D59")
That is, I removed .TEXT
Any help?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Steve E" wrote in message
...
Gord,

I'm trying to do basically the same thing but when I used this version of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy if
I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want to
print this particular footer on... does using the BeforePrint event here
mean that I need to do that for each worksheet - specify the sheet and the
text in the VBE editor?

Thanks,

Steve E


"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn

wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select
the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn

wrote:

I'm trying to set up spreadsheets where the footer changes depending
on
certain cells contents. Has anyone been able to do that?

Thanks.







  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Can I link a cell's contents to the header or footer in Excel?

What do you see in D59 of the "Quote Form" worksheet?

And I would be very specific about changing the footers. I'd specify each
worksheet with code very similar to what you have.



Steve E wrote:

Gord,

I'm trying to do basically the same thing but when I used this version of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy if I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want to
print this particular footer on... does using the BeforePrint event here
mean that I need to do that for each worksheet - specify the sheet and the
text in the VBE editor?

Thanks,

Steve E

"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn
wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn
wrote:

I'm trying to set up spreadsheets where the footer changes depending on
certain cells contents. Has anyone been able to do that?

Thanks.





--

Dave Peterson
  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Can I link a cell's contents to the header or footer in Excel?

The total number of characters in the footer (left, right, and center) can't
exceed 255 (256???). So 742 is too many.





Steve E wrote:

Well... not really. Still get the same error.

I have this in the *workbook* module [right click on the excel icon in
menubar and 'view code'...]

Does it matter how the cell I'm referencing is formatted? [General] or how
many characters are in that field? [742]

??

Thanks in advance!

Steve
"Bernard Liengme" wrote:

You code worked for me when placed in a *workbook* module
I changed line 3 to .PageSetup.CenterFooter = .Range("D59")
That is, I removed .TEXT
Any help?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Steve E" wrote in message
...
Gord,

I'm trying to do basically the same thing but when I used this version of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy if
I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want to
print this particular footer on... does using the BeforePrint event here
mean that I need to do that for each worksheet - specify the sheet and the
text in the VBE editor?

Thanks,

Steve E


"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn

wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select
the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn

wrote:

I'm trying to set up spreadsheets where the footer changes depending
on
certain cells contents. Has anyone been able to do that?

Thanks.








--

Dave Peterson


  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Can I link a cell's contents to the header or footer in Excel?

I got it to work with 191 as cell length but got your error when length was
307. So I guess the limit is 256 or 255.
If I have in D5 the value 1234 formatted to show $1,234.00 then the footer
does not get the format.
I expect you could use a Application.TEXT(D5,"$0,000.00) type of thing but
it seems we have found your problem - too much data!
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Steve E" wrote in message
...
Well... not really. Still get the same error.

I have this in the *workbook* module [right click on the excel icon in
menubar and 'view code'...]

Does it matter how the cell I'm referencing is formatted? [General] or how
many characters are in that field? [742]

??

Thanks in advance!

Steve
"Bernard Liengme" wrote:

You code worked for me when placed in a *workbook* module
I changed line 3 to .PageSetup.CenterFooter = .Range("D59")
That is, I removed .TEXT
Any help?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Steve E" wrote in message
...
Gord,

I'm trying to do basically the same thing but when I used this version
of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy
if
I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want
to
print this particular footer on... does using the BeforePrint event
here
mean that I need to do that for each worksheet - specify the sheet and
the
text in the VBE editor?

Thanks,

Steve E


"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn

wrote:

Thank you. Any way to link it to a certain sheet called Project
Inputs,
versus only the active sheet. Also, what are the chances I can
select
the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn

wrote:

I'm trying to set up spreadsheets where the footer changes
depending
on
certain cells contents. Has anyone been able to do that?

Thanks.









  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Can I link a cell's contents to the header or footer in Excel?

Dave & Bernhard,

Thanks so much for looking at this for me!

I've learned something valuable (to me at least).

Thanks again!

"Dave Peterson" wrote:

What do you see in D59 of the "Quote Form" worksheet?

And I would be very specific about changing the footers. I'd specify each
worksheet with code very similar to what you have.



Steve E wrote:

Gord,

I'm trying to do basically the same thing but when I used this version of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy if I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want to
print this particular footer on... does using the BeforePrint event here
mean that I need to do that for each worksheet - specify the sheet and the
text in the VBE editor?

Thanks,

Steve E

"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn
wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn
wrote:

I'm trying to set up spreadsheets where the footer changes depending on
certain cells contents. Has anyone been able to do that?

Thanks.





--

Dave Peterson

  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Can I link a cell's contents to the header or footer in Excel?

Does anyone know how to select a specific font and size when using this code:
Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub


Thanks

"Dave Peterson" wrote:

The total number of characters in the footer (left, right, and center) can't
exceed 255 (256???). So 742 is too many.





Steve E wrote:

Well... not really. Still get the same error.

I have this in the *workbook* module [right click on the excel icon in
menubar and 'view code'...]

Does it matter how the cell I'm referencing is formatted? [General] or how
many characters are in that field? [742]

??

Thanks in advance!

Steve
"Bernard Liengme" wrote:

You code worked for me when placed in a *workbook* module
I changed line 3 to .PageSetup.CenterFooter = .Range("D59")
That is, I removed .TEXT
Any help?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Steve E" wrote in message
...
Gord,

I'm trying to do basically the same thing but when I used this version of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy if
I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want to
print this particular footer on... does using the BeforePrint event here
mean that I need to do that for each worksheet - specify the sheet and the
text in the VBE editor?

Thanks,

Steve E


"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn

wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select
the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn

wrote:

I'm trying to set up spreadsheets where the footer changes depending
on
certain cells contents. Has anyone been able to do that?

Thanks.








--

Dave Peterson

  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Can I link a cell's contents to the header or footer in Excel?

Sub CellInFooter22()
With ActiveSheet.PageSetup
.CenterFooter = "&""Algerian,Regular""&12" & Range("A1")
End With
End Sub


Gord


On Tue, 17 Oct 2006 08:44:02 -0700, djoslyn
wrote:

Does anyone know how to select a specific font and size when using this code:
Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub


Thanks

"Dave Peterson" wrote:

The total number of characters in the footer (left, right, and center) can't
exceed 255 (256???). So 742 is too many.





Steve E wrote:

Well... not really. Still get the same error.

I have this in the *workbook* module [right click on the excel icon in
menubar and 'view code'...]

Does it matter how the cell I'm referencing is formatted? [General] or how
many characters are in that field? [742]

??

Thanks in advance!

Steve
"Bernard Liengme" wrote:

You code worked for me when placed in a *workbook* module
I changed line 3 to .PageSetup.CenterFooter = .Range("D59")
That is, I removed .TEXT
Any help?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Steve E" wrote in message
...
Gord,

I'm trying to do basically the same thing but when I used this version of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy if
I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want to
print this particular footer on... does using the BeforePrint event here
mean that I need to do that for each worksheet - specify the sheet and the
text in the VBE editor?

Thanks,

Steve E


"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn

wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select
the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn

wrote:

I'm trying to set up spreadsheets where the footer changes depending
on
certain cells contents. Has anyone been able to do that?

Thanks.








--

Dave Peterson


  #15   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Can I link a cell's contents to the header or footer in Excel?

Thank you so much.

"Gord Dibben" wrote:

Sub CellInFooter22()
With ActiveSheet.PageSetup
.CenterFooter = "&""Algerian,Regular""&12" & Range("A1")
End With
End Sub


Gord


On Tue, 17 Oct 2006 08:44:02 -0700, djoslyn
wrote:

Does anyone know how to select a specific font and size when using this code:
Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub


Thanks

"Dave Peterson" wrote:

The total number of characters in the footer (left, right, and center) can't
exceed 255 (256???). So 742 is too many.





Steve E wrote:

Well... not really. Still get the same error.

I have this in the *workbook* module [right click on the excel icon in
menubar and 'view code'...]

Does it matter how the cell I'm referencing is formatted? [General] or how
many characters are in that field? [742]

??

Thanks in advance!

Steve
"Bernard Liengme" wrote:

You code worked for me when placed in a *workbook* module
I changed line 3 to .PageSetup.CenterFooter = .Range("D59")
That is, I removed .TEXT
Any help?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Steve E" wrote in message
...
Gord,

I'm trying to do basically the same thing but when I used this version of
the code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Quote Form")
.PageSetup.CenterFooter = .Range("D59").Text
End With
End Sub

I get a runtime error: "Unable to set the CenterFooter property of the
PageSetup class"

I'm also interested in the font formatting info but will be soooo happy if
I
can just make this part work.

ALso, there are several other sheets in this workbook that I don't want to
print this particular footer on... does using the BeforePrint event here
mean that I need to do that for each worksheet - specify the sheet and the
text in the VBE editor?

Thanks,

Steve E


"Gord Dibben" wrote:

Instead of With ActiveSheet

With Sheets("Project Inputs")

Not sure how to change font and size.

Will work on it while waiting for someone to leap in.


Gord

On Tue, 22 Aug 2006 09:01:02 -0700, djoslyn

wrote:

Thank you. Any way to link it to a certain sheet called Project Inputs,
versus only the active sheet. Also, what are the chances I can select
the
font and sized of the footer?

Thanks again

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").text
End With
End Sub

Better yet...............

Place the code in a BeforePrint event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Text
End With
End Sub

Right-click on the Excel Icon left of "File" on the menubar.

Select "View Code"

Copy/paste the BeforePrint code above into that module.


Gord Dibben MS Excel MVP

On Mon, 21 Aug 2006 14:47:32 -0700, djoslyn

wrote:

I'm trying to set up spreadsheets where the footer changes depending
on
certain cells contents. Has anyone been able to do that?

Thanks.








--

Dave Peterson



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
how to set up a built in header footer in excel JP Excel Discussion (Misc queries) 5 August 9th 06 08:58 PM
Excel Header and Footer Dhinesh Excel Discussion (Misc queries) 4 February 23rd 06 10:59 PM
can I use a cell's contents as part of a custom header? NHVP Treasurer Excel Discussion (Misc queries) 1 February 12th 06 03:28 AM
Set up global custom header and footer in Excel worksheets? KRollins Excel Worksheet Functions 1 June 14th 05 10:50 PM
How to insert a picture in the Footer (not the Header) in Excel 20 jmon Excel Worksheet Functions 2 March 17th 05 05:59 AM


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