Adding a cell's content into the header - Excel for Mac 2011

zgall1

New Member
Joined
Jul 6, 2012
Messages
27
Office Version
  1. 2016
Platform
  1. MacOS
I am using Excel for Mac 2011. I have text contained within a cell and I would like to append it to text I have entered in the center header. For instance, the center header has text "Tortor Euismod Ornare Pellentesque" and cell A1 has text that says "Ligula Ridiculus" and I would like the center header to read "Tortor Euismod Ornare Pellentesque - Ligula Ridiculus" and change dynamically if the text in A1 is changed. Is there a way to accomplish this? Thanks!
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi, it this in a chart?
=cell_reference#1&" - "&cell_reference#2
thus would provide dynamic header title based on the text found in the cells of your choice.
you may opt to add a condition to ignore the second reference if the cell was empty as to avoid having something like "Tortor Euismod Ornare Pellentesque - "
 
Upvote 0
No this is not a chart. It is the header of the file that is only visible when the file is printed.
 
Upvote 0
So you mean to say you would like the print header to reflect the content of two cells?
try this:
Code:
[COLOR=#333333][FONT=Consolas]Sub UpdateHeader()[/FONT][/COLOR]
   ActiveSheet.PageSetup.Leftheader = Range("A1").
Value [COLOR=#333333][FONT=Consolas]End Sub[/FONT][/COLOR]

as seen here: link.
 
Upvote 0
That worked. Thanks!

Any idea how I can also get the text to be set to a specific font and font size, rather than the default?
 
Upvote 0
That worked. Thanks!

Any idea how I can also get the text to be set to a specific font and font size, rather than the default?
Most welcome.
do you mean to have a non-specific font type and size based on the document or do you want to modify the default?
A new document would be default to what font and font size that is set within the settings, but an old file should have its own font as set during the last save...
 
Upvote 0
Based on the document. So I know there is some application-wide default but I would like to just have this particular section of the header be formatted with a specific font and size, rather than default.
 
Upvote 0
If you want to avoid VBA, you can specify rows that will be repeated on every sheet.
On the Layout ribbon, click Repeat Titles and select the rows that you want on every sheet.
 
Upvote 0
That might work. I am going to try that out. I hate the header functionality in Excel. It sucks.
 
Upvote 0
Based on the document. So I know there is some application-wide default but I would like to just have this particular section of the header be formatted with a specific font and size, rather than default.
I will look into it and get back to you. I guess the best shot would be VBA as well...
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,415
Members
448,960
Latest member
AKSMITH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top