Insert text in the header of a worksheet from the text contained in a cell

1

To set the header of a worksheet, go to Page Setup > Header / Footer > Customize header. Let's assume that in the middle section, I want a title that is in cell A1 to appear. How can I do this?

    
asked by anonymous 18.11.2016 / 12:14

2 answers

1

Everything indicates that what I want is not possible without recourse to VBA ( link ); Apparently it would have to make a macro to populate the section of the respective header.

Sub HeaderFromA1()
    ActiveSheet.PageSetup.LeftHeader = Range("A1").Value
End Sub
    
18.11.2016 / 15:17
1

Hello! Unfortunately with the Excel Page Setup header / footer feature, it is not possible, but you get the same result with another feature without using VBA.

  • In Excel, click the PAGE LAYOUT tab
  • Then click PRINT TITLES
  • In the window that will open, click the WORKSHEET tab
  • In the "Rows to repeat at the top" field, choose the cell or entire row you want to use as a header or footer for all pages.
  • Click OK and view the print
  • Hugs !! www.learnoffice.com.br

        
    20.11.2016 / 01:54