Closed Thread
Results 1 to 9 of 9

VBA code to search all merged cells and then unmerge them filling them with values

  1. #1
    Registered User
    Join Date
    03-22-2008
    Posts
    3

    VBA code to search all merged cells and then unmerge them filling them with values

    Hi I would like some help on following.

    I have a sheet which has various groups of merged cell. Each merged cell has its own different value. Now What I would like to do is unmerge all the cells, and then fill the unmerged cells with the same value. I am uploading an excel workbook which has 2 sheets. One is the raw data that we have and one sheet is the output we need to achieve. Can someone help me do this?
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    This should unmerge the cells.
    Your RAW example didn't include a 2007 placement date, did you want that added?
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    03-22-2008
    Posts
    3
    Quote Originally Posted by mikerickson
    This should unmerge the cells.
    Your RAW example didn't include a 2007 placement date, did you want that added?
    Please Login or Register  to view this content.
    Oh, first of thank you so much!! this is great I would have never been able to do this on my own. And That 2007 got deleted when i was making this example file. I was just trimming it down to make it lighter. But thanks :D.

    Just one more thing if possible, can you add documentation to this code. I am new at this will help me understand it.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-22-2008
    Posts
    3
    Quote Originally Posted by mikerickson
    Please Login or Register  to view this content.
    Thank you yet again.

  6. #6
    Registered User
    Join Date
    05-18-2009
    Location
    Cairo
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: VBA code to search all merged cells and then unmerge them filling them with value

    Thank you very much for this post

  7. #7
    Registered User
    Join Date
    05-21-2009
    Location
    florham park, nj
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: VBA code to search all merged cells and then unmerge them filling them with value

    Hello, when I try this exact script i get an error in the line that says
    "For Each oneCell In"...

    what am I supposed to put after In? I copy pasted what you put directly and it doesn't work, help!!

    Thanks in advance!

  8. #8
    Registered User
    Join Date
    01-04-2012
    Location
    karnataka
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: VBA code to search all merged cells and then unmerge them filling them with value

    Awesome ... Thank you so much

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA code to search all merged cells and then unmerge them filling them with value

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

Closed 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