Results 1 to 3 of 3

Thread: vba autofit doesn't work on wrapped text cells
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2015
    Posts
    195
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default vba autofit doesn't work on wrapped text cells

    Hi I have a sheet that has variable amount of text in column A. The text is fairly long, it's a paragraph. These cells are wrapped text. The issue is when i do an autofit (either via VBA or even when i do it manually), the autofit works for few of the cells but some will have extra space at the end. when i either make the column width much wider or narrower, the auto fit seems to work, but not at the width i'm trying to keep those cells at. I've tried specifying the range or looping through each row to do autofit one by one, but all of these solutions give me the same issue. Any feedback would be appreciated. Thank you for your help!

    Code:
    With Sheets("ABC")    With .Columns("A:A")
            With .Font
                .Name = "Cambria"
                .Color = RGB(12, 35, 64)
                .Size = 12
            End With
            .ColumnWidth = 96
            .HorizontalAlignment = xlJustify
            .VerticalAlignment = xlTop
            .WrapText = True
        End With
        
        .Cells.EntireRow.AutoFit
        
    End With

  2. #2
    Board Regular
    Join Date
    Feb 2015
    Posts
    195
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: vba autofit doesn't work on wrapped text cells

    bump, any help?

  3. #3
    Board Regular
    Join Date
    Feb 2015
    Posts
    195
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: vba autofit doesn't work on wrapped text cells

    bumping again.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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