Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2007
    Location
    Gray, Louisiana, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA Commands (2003)

    Hello all. The code below I keep in Personal.xls to align top>left>Wrap my text. Works fine, one cell at a time, How could I change it so that it would format all cells in a selected area????
    Thanks

    Sub TopLeftWrap()
    '
    ' TopLeftWrap Macro
    ' Macro recorded 3/6/2007 by Stans

    '
    ActiveCell.Select
    With Selection
    .HorizontalAlignment = xlLeft
    .VerticalAlignment = xlTop
    .WrapText = True
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = True
    End With
    End Sub

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Commands (2003)

    Remove the line:

    <code>
    ActiveCell.Select
    </code>
    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Jan 2007
    Location
    Gray, Louisiana, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Commands (2003)

    Great, I was trying too hard to replace that line.
    Thanks Legare

Posting Permissions

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