+ Reply to Thread
Results 1 to 4 of 4

Select a Range and Format

  1. #1
    Jaina WIlliams
    Guest

    Select a Range and Format

    I am looking to do 2 things
    1> I want to select the whole worksheet and remove any
    fill colors and then
    I want to select a specific Range in a spreadsheet (eg
    B5:d10) and right Justify all the data in the worksheet


    Thanks

  2. #2
    Lonnie M.
    Guest

    Re: Select a Range and Format

    Hi, if you record a macro and manually do what you describe it will
    generate the following code:

    Cells.Select
    Selection.Interior.ColorIndex = xlNone
    Range("B5:D10").Select
    With Selection
    .HorizontalAlignment = xlRight
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With

    HTH--Lonnie M.


  3. #3
    PaulD
    Guest

    Re: Select a Range and Format

    "Jaina WIlliams" <[email protected]> wrote in message
    news:[email protected]...
    : I am looking to do 2 things
    : 1> I want to select the whole worksheet and remove any
    : fill colors and then
    : I want to select a specific Range in a spreadsheet (eg
    : B5:d10) and right Justify all the data in the worksheet
    :
    : Thanks

    Have you tried using the macro recorder while doing this? It will write the
    code for you.
    Paul D



  4. #4
    Bob Phillips
    Guest

    Re: Select a Range and Format

    But then you should tidy it up to get rid of the garbage

    Cells.Interior.ColorIndex = xlNone
    Range("B5:D10").HorizontalAlignment = xlRight

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Lonnie M." <[email protected]> wrote in message
    news:[email protected]...
    > Hi, if you record a macro and manually do what you describe it will
    > generate the following code:
    >
    > Cells.Select
    > Selection.Interior.ColorIndex = xlNone
    > Range("B5:D10").Select
    > With Selection
    > .HorizontalAlignment = xlRight
    > .VerticalAlignment = xlBottom
    > .WrapText = False
    > .Orientation = 0
    > .AddIndent = False
    > .IndentLevel = 0
    > .ShrinkToFit = False
    > .ReadingOrder = xlContext
    > .MergeCells = False
    > End With
    >
    > HTH--Lonnie M.
    >




+ 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