+ Reply to Thread
Results 1 to 32 of 32

wrapping text in header

Hybrid View

  1. #1
    Registered User
    Join Date
    06-23-2015
    Location
    wisconsin USA
    MS-Off Ver
    13
    Posts
    59

    wrapping text in header

    I'm putting a long line of text in the center header (left and right have something else) and it extends into the other header sections. Is there some way to wrap the text in the header so it doesn't over write the other sections?

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    Select the cell with the long text. Click on the Home Tab, Wrap Text, then click on Format, AutoFit Row Height. You will likely have to manually adjust the width of the column to get a pleasing result.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: wrapping text in header

    I don't think you can. You'll need to enter a line break (ALT + Enter) to wrap the text.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: wrapping text in header

    Off topic: Oh, and from a regulated environment point of view, stay away from putting any sort of pertainent information into a header since there is no easy way to protect it from being changed. Even if the sheet and workbook are protected, the header can still be changed.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: wrapping text in header

    maybe enter a space in the next cell?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: wrapping text in header

    maybe enter a space in the next cell?
    No, it will just write on top of each other if the text is long enough. I did some research and Microsoft didn't think anyone would want that option. If the text is too long, add a manual line break. Sorry

  7. #7
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: wrapping text in header

    Alt-Enter isn't needed to add a line break in the header. If you go into 'Page Layout' view (it's on the View tab) then you can just press Enter where you want the line break.

    Regards,
    Aardigspook

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    Confirmed that the order of entry doesn't matter. The left and right boxes should have short entries or short multi line entries.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    ChemistB

    You will get the over-writing if the entries in all three boxes exceed the allowable characters for a single line. You can have more than one line of text in each box.

    Header two.JPG
    Last edited by newdoverman; 07-10-2015 at 02:37 PM.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: wrapping text in header

    Sorry, mis-read the question - thought it was headings, not headers
    Last edited by FDibbins; 07-10-2015 at 03:36 PM.

  11. #11
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: wrapping text in header

    I tried the space and it worked for me no matter how long the text was.
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    Sorry, misread the problem. In the header, if you hit enter before going outside the boundaries of the centre block of text for the header the text will stay inside that block. If you happen to go outside that block, the header appears to have only 1 section. This isn't true. The three sections are still there. Click ABOVE the header text and this is what you should see.

    The Left and Right Boxes were filled in before the Centre box. Don't know if that makes a difference.
    Header.JPG

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: wrapping text in header

    I'm on Excel 2010 and I get the headers overwriting each other. See attached.
    Attached Images Attached Images

  14. #14
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: wrapping text in header

    @Aardigspook Good point

  15. #15
    Registered User
    Join Date
    06-23-2015
    Location
    wisconsin USA
    MS-Off Ver
    13
    Posts
    59

    Re: wrapping text in header

    The text is a combination of static text, file path, and filename. Some text is auto text from Excel, some is entered by the user in a specific cell which is then concatenated with the other text.

    Enter or Alt-Enter isn't an option since the file path is usually where the break needs to occur.

    I could insert a CR/LF every 50 characters or so but that makes the text hard to read.

  16. #16
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    Can you give examples of what you are dealing with....including some extremes in a workbook?

  17. #17
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    @Ford
    I think we should go for a beer!!

  18. #18
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: wrapping text in header

    no need for an reason (excuse?) for that, I will look you up next time we are in that area

  19. #19
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: wrapping text in header

    @NewDover, yes, I get that there can be multiple lines in a box. I was just demonstrating Dr. Allen's point that it doesn't happen automatically, even when there's something in the side headers as nigel claimed.

  20. #20
    Registered User
    Join Date
    06-23-2015
    Location
    wisconsin USA
    MS-Off Ver
    13
    Posts
    59

    Re: wrapping text in header

    @ChemistB
    my initials are d.r. I only use Dr. in court or trying to impress the ladies.

  21. #21
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: wrapping text in header

    Sorry I didn't realize it was it was the header either. I originally read it as if it were a problem with the column heading which would usually just be the first row.

  22. #22
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    @ChemistB

    I understand. It would make a nice mod for the header and footer to have the margins for the 3 boxes variable with word wrap and other formatting incorporated instead of this manual thing that you have to "keep you wits about you" in order to get what you want.

  23. #23
    Registered User
    Join Date
    06-23-2015
    Location
    wisconsin USA
    MS-Off Ver
    13
    Posts
    59

    Re: wrapping text in header

    One example is:

    File Location: \MyLocation\MyDept Spreadsheets\client name\Test Method 9999\Sample identification data.xlsm

    variable text would include:
    MyDept
    client name
    Test Method number
    Sample identification data


    We can't use the autotext path because the official file is stored in a version controlled directory. When the file is edited, it's downloaded to a temp directory on the local hard drive and the initial file is locked. The path when it's loaded, printed, or saved is the local directory. The local file is deleted when it's moved back to the controlled directory. The filename will be the same so it's picked up as autotext. The static text at the beginning is the same so it's hard coded in. The rest is extracted from a worksheet and is unique for each client.

    The left header section has the date and time printed. The right header section has page numbers. When the above text is inserted in the center section, it overwrites the other text.

    The footer sections are populated as well so it can't be moved there plus some combinations are too long for a single line even if the other sections were blank. The sample identification data can be 35 to 40 characters
    Last edited by dr01allen; 07-10-2015 at 04:47 PM.

  24. #24
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    This is the best that I can do by using a picture of what I wanted to put in the center section of the header.Test Header file.JPG

  25. #25
    Registered User
    Join Date
    06-23-2015
    Location
    wisconsin USA
    MS-Off Ver
    13
    Posts
    59

    Re: wrapping text in header

    There may not be a solution that fits the URS. Which means we need to change the URS.
    But I don't want to throw in the towel without at least getting it damp......

  26. #26
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: wrapping text in header

    The only solution I can come up with is to move the multi-line section of the centre header down so it doesn't overwrite the left and right headers.
    Here's a pic:
    Longheadertext.png
    As you can see from the pic, you'll need to make sure the worksheet margins are adjusted to give enough room for the header.

    It's not an ideal solution, but might fit your needs until Microsoft give us the functionality to move the internal header margins.

    Regards,
    Aardigspook

  27. #27
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    You might be able to get the effect you want by placing what would be in the centre section within the first 4 or 5 rows of the worksheet merged with borders removed. To have this repeat on subsequent pages use the Print Titles dialogue and have those 4 or 5 rows repeated.

    Result:
    Header - ndm.JPG

  28. #28
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: wrapping text in header

    I suggest you imbed your header into the first cells of the worksheet. Besides the benefit of text wrapping, it also can be protected while the headings can not be.

  29. #29
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: wrapping text in header

    @ ChemistB

    I used the first few rows of the worksheet as shown in msg#27. Is that pretty much what you had in mind?

  30. #30
    Registered User
    Join Date
    06-23-2015
    Location
    wisconsin USA
    MS-Off Ver
    13
    Posts
    59

    Re: wrapping text in header

    Using Title Rows might be a solution. Our SOP says it must go in the header. Maybe I can expand the definition of header.

  31. #31
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: wrapping text in header

    The only issue I've ever had with using embedded cells is the Page x of y ability. Can't do that within the spreadsheet without macros. So I usually keep that in the footer since it's not "critical or confidential information"
    In one place I worked, I used imbedded Word Docs since their header formatting couldn't be reproduced by Excel. That's a pain though.

  32. #32
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: wrapping text in header

    @newdover,
    Yes, that would be it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Wrapping Text
    By joebell in forum Excel General
    Replies: 8
    Last Post: 09-14-2014, 09:06 AM
  2. Wrapping Text
    By John Bates in forum Excel General
    Replies: 2
    Last Post: 09-22-2009, 02:26 AM
  3. [SOLVED] wrapping text
    By Jerry in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-03-2006, 10:15 AM
  4. [SOLVED] Text Wrapping
    By RhondaRoo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-17-2006, 10:40 PM
  5. Wrapping Text
    By Confused in forum Excel General
    Replies: 2
    Last Post: 06-16-2005, 08:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1