+ Reply to Thread
Results 1 to 2 of 2

Merge & Center Macro Button

  1. #1
    Registered User
    Join Date
    03-02-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Merge & Center Macro Button

    Hello. Is it possible to create a macro button that merges and centers an specific column range. i.e. A2:A10?. Thanks.

  2. #2
    Registered User
    Join Date
    03-02-2010
    Location
    Chennai,India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Merge & Center Macro Button

    Quote Originally Posted by SCFM View Post
    Hello. Is it possible to create a macro button that merges and centers an specific column range. i.e. A2:A10?. Thanks.
    Yes It is possible. Please check with the given code and customize as your need. Let me know if you are unsure of something.

    Range("A2:A10").Select
    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Selection.Merge
    With Selection
    .HorizontalAlignment = xlGeneral
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = True
    End With
    Last edited by Paul; 03-05-2010 at 02:26 AM.

+ 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