+ Reply to Thread
Results 1 to 4 of 4

Merge and Center

  1. #1
    Registered User
    Join Date
    05-25-2016
    Location
    United States, Texas
    MS-Off Ver
    MS Office 2010
    Posts
    86

    Merge and Center

    Hello, I have attached a sample file to help explain.

    I want to merge and center all the cells in column A that correspond to that states cities without having to go line by line. Is there a way to do this automatically?

    EX: I want cells A2:A4, A5:A7, A8:A9, A11:A12, and A13:A15 to merge and center.

    Maybe an if macro? I need some help lol

    The reason is because i have multiple workbooks similar to this that are 50,000+ lines and going line by line would take a week.

    Thanks in advance!!!!!!!!!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,381

    Re: Merge and Center

    Before you do this, please be aware that merged cells can cause problems later on if you need formulae to work with them: most people would advise against them at all costs.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Merge and Center

    Ali is right!! Unless you have a VERY good reason for doing this.... don't even think about it... For 100,000 reasons you'd be better to put "State" in C1 and use this formula in C2, copied down...

    =IF(A2="",C1,A2)

    Then select column C, copy & paste values.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Merge and Center

    Just to add my 2 cents worth, I totally agree (and always advise) that you should avoid using merged dells if at all possible - they cause all sorts of problems with formulas
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Merge & center with certain criteria
    By cjhale in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-08-2015, 10:21 AM
  2. Merge and Center Gridlines
    By sammyhellsyea in forum Excel General
    Replies: 1
    Last Post: 09-19-2012, 03:34 PM
  3. Alternative To Merge & Center
    By Spencer in forum Excel General
    Replies: 2
    Last Post: 03-14-2011, 08:17 PM
  4. Merge and Center
    By lizardlounge in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2010, 01:56 AM
  5. merge and center
    By GINA in forum Excel General
    Replies: 3
    Last Post: 08-15-2005, 12:05 PM
  6. Merge & Center
    By Rj in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-01-2005, 04:06 PM
  7. Merge & Center
    By JT in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2005, 03:06 PM

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