+ Reply to Thread
Results 1 to 12 of 12

Text Won't Wrap!!

Hybrid View

  1. #1
    Registered User
    Join Date
    09-07-2009
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    15

    Text Won't Wrap!!

    Hi all
    I am new to this forum and have only limited experience of excel.
    I have a worksheet where i need three columns at fixed widths and in one of these columns i need the text to wrap. I have a macro and have included a wrap text function in it but it doesn't seem to wrap text!! No cells are merged and the row height has not been altered from the default height. I would very much appreciate if one of you could look at the macro(pasted below) and tell me why the text won't wrap. I have looked through forums and found answers to this question, but none of the solutions I have come across seem to work
    Many thanks.
    Northbank
    Private Sub CommandButton1_Click()
    
    Application.ScreenUpdating = False
    
    ActiveSheet.Unprotect Password:="123"
        
    Range("A4:T1300").Select
        Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
        
    Range("A3:T3").Select
        If ActiveSheet.AutoFilterMode = False Then Selection.AutoFilter
    
        
    Range("A4").Select
        Selection.ColumnWidth = 48
         
    Range("B4").Select
        Selection.ColumnWidth = 32
         
    Range("C4").Select
        Selection.ColumnWidth = 19
        
    Range("A4:A1300").Select
    With Selection
    .WrapText = True
    End With
         
    Range("A4:D1300").Select
        Selection.Locked = False
        
    Range("F4:T1300").Select
        Selection.Locked = False
        
    
    Range("B4:T1300").Select
        With Selection.Font
            .Name = "Calibri"
            .FontStyle = "Regular"
            .Size = 11
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
        End With
        
    Range("A4:A1300").Select
        With Selection.Font
        .Name = "Calibri"
            .FontStyle = "Bold"
            .Size = 11
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = 5
            End With
            
    
        
    ActiveSheet.Protect Password:="123", _
     DrawingObjects:=True, Contents:=True, Scenarios:=True _
            , AllowFiltering:=True, AllowInsertingHyperlinks:=True
            
    Rows("4:4").Select
        ActiveWindow.FreezePanes = True
        ActiveWindow.Zoom = 80
       
    Range("C2").Select
            ActiveWindow.ScrollRow = 1
            ActiveWorkbook.Save
            Application.ScreenUpdating = True
        
    End Sub
    Last edited by northbank; 09-07-2009 at 05:49 AM. Reason: Add code tags

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Text Won't Wrap!!

    Please add code tags to your post.


    Can you post a workbook with some example data that does not wrap.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-07-2009
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Text Won't Wrap!!

    hi Andy
    Sorry about the tags

    I have attached the sheet conatining the macro. It's the 'Sort and Save' macro
    and the password is 123
    Rows 11 and 27 do not wrap the text
    Thanks
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Text Won't Wrap!!

    Range("A4:A1300").Select
    With Selection
    .WrapText = True
    .Rows.AutoFit
    End With

  5. #5
    Registered User
    Join Date
    09-07-2009
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Text Won't Wrap!!

    Thanks a million Andy for your help

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Text Won't Wrap!!

    No problem. Don't forget to edit your first post.

  7. #7
    Registered User
    Join Date
    09-07-2009
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Text Won't Wrap!!

    Sorry Andy

    I just changed the Font Type to 'Arial Narrow' and the font size from 11 to 10 and row 27 won't wrap now. It leaves out the word 'Ford'
    Do you know of any reason why this might happen, or a fix for it?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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