+ Reply to Thread
Results 1 to 4 of 4

Merge and Center Multiple Cells with the same data with a button click

  1. #1
    Forum Contributor
    Join Date
    08-03-2005
    Posts
    269

    Merge and Center Multiple Cells with the same data with a button click

    Hello,

    I have an odd need for a macro. I have a sitution where I will need a dynamic macro that looks at the sheet from say 2 to 1000 and B to GZ. Starting from B2, when the macro sees in this range two or more cells to the right or down or both that have the exact same value in them it takes that range and merges and centers the entire range. The range needs to be dynamic but the data will always be a box, i.e. 4x8, 1x2, 3x3, etc.

    I have included a file to explain what I am trying to do. The file contains a before and after tab, altough this should all happen on the before tab. The after tab is just there to show you what the before tab should look like when the macro is done.

    Thanks in advance for any help

    File: Merge.xlsm

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Merge and Center Multiple Cells with the same data with a button click

    Hi

    Are your "blocks" always going to have blank cells surrounding them? Or could they be contained within some non inclusive text?


    rylo

  3. #3
    Forum Contributor
    Join Date
    08-03-2005
    Posts
    269

    Re: Merge and Center Multiple Cells with the same data with a button click

    Usually there will be some nonblank cells adjacent to the block, likely a new block. Where the text is not the same, that would be considered outside of the block

  4. #4
    Forum Contributor
    Join Date
    08-03-2005
    Posts
    269

    Re: Merge and Center Multiple Cells with the same data with a button click

    any help anyone?

+ 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