+ Reply to Thread
Results 1 to 3 of 3

Macro to merge and Center varied range of data in a fixed row

  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2007
    Posts
    37

    Macro to merge and Center varied range of data in a fixed row

    Hi Everyone,

    Please see attached the example worksheet. I am wondering if there is a way to write a macro that will change data from individual strings within a cell row to merged and centre data for that set of data. The issue is the data in the row will be varied i.e. sometimes there will be 20 x 2013 other times there may be 22 X 2013 etc. however, the data will always be fixed in the same row on the worksheet.

    At the moment the best I have is a recorded macro, which really doesn't work too great and I end up fixing it constantly.

    Any help would be greatly appreciated.

    Thanks!!
    Attached Files Attached Files

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to merge and Center varied range of data in a fixed row

    Hi, lbesley,

    I´m no friend of merged cells as they will present more problems than doing benefits.

    Place the cursor in the row you want to work with and test the code on a copy of your worksheet:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Macro to merge and Center varied range of data in a fixed row

    This should do
    Please Login or Register  to view this content.

+ 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 and Center Multiple Cells with the same data with a button click
    By caliskier in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2012, 06:01 PM
  2. Merge & Center Macro Button
    By SCFM in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2010, 02:01 AM
  3. Center data in a fixed length text field
    By indullg83 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-23-2009, 01:18 PM
  4. merge and center cells using macro
    By iscar_marius in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-13-2009, 03:42 PM
  5. [SOLVED] Macro function needed for varied searches using a data filter
    By CC_rider in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-02-2005, 03:05 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