Results 1 to 4 of 4

Thread: Unmerge Cells and Fill with Duplicate Values

  1. #1
    Member
    Join Date
    Nov 2011
    Posts
    41
    Rep Power
    0

    Lightbulb Unmerge Cells and Fill with Duplicate Values

    Hi all,

    I have range of data on my excel sheet and data is grouped and merged now what i want to unmerge these cells and fill the rows with the duplicate values.
    For example:
    My Actual data.

    aaa sss r
    t
    h
    ddd y
    f
    sd
    eee w
    w
    sd
    bbb fff y
    j
    o
    kkk hj
    d
    sd
    rr d
    w
    ccc ttt sd
    sd
    gt
    yyy u
    o
    l
    ccc hh gt
    f
    e
    ew

    required result

    aaa sss r
    aaa sss t
    aaa sss h
    aaa ddd y
    aaa ddd f
    aaa ddd sd
    aaa eee w
    aaa eee w
    aaa eee sd
    bbb fff y
    bbb fff j
    bbb fff o
    bbb kkk hj
    bbb kkk d
    bbb kkk sd
    bbb rr d
    bbb rr w
    ccc ttt sd
    ccc ttt sd
    ccc ttt gt
    ccc yyy u
    ccc yyy o
    ccc yyy l
    ccc hh gt
    ccc hh f
    ccc hh e
    ccc hh ew

    Thanks
    Prince

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    Try this...
    Code:
    Sub FillEmptyRanges()
        
        Dim rng As Range
        Set rng = Range("A1").CurrentRegion.SpecialCells(xlCellTypeBlanks)
        With rng
            .UnMerge
            .FormulaR1C1 = "=R[-1]C"
            For Each rng In rng
                With rng
                    .Value = .Value
                End With
            Next rng
        End With
        
    End Sub
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    12
    or
    Code:
    Sub snb()
        Cells(1).CurrentRegion.unmerge
        For Each ar In Cells(1).CurrentRegion.Columns(1).SpecialCells(4).Areas
            ar.Value = ar.Cells(1).Offset(-1)
            ar.Offset(, 1) = ar.Offset(, 1).Cells(1).Offset(-1)
        Next
    End Sub

  4. #4
    Senior Member LalitPandey87's Avatar
    Join Date
    Sep 2011
    Posts
    222
    Rep Power
    13
    Hi Prince,

    Below is the link where you can find the same as you want.

    Fill Merge Cell Hierarchy | Power Desk

    There i have uploaded an excel file with sample data with two different method. Use what is helpful to you.

Similar Threads

  1. Replies: 6
    Last Post: 05-16-2013, 09:56 AM
  2. Replies: 7
    Last Post: 04-22-2013, 01:41 PM
  3. Subtraction Of Series Of Cells' / Array Values
    By PcMax in forum Excel Help
    Replies: 6
    Last Post: 10-26-2012, 11:55 PM
  4. Find duplicate values
    By excel_learner in forum Excel Help
    Replies: 4
    Last Post: 10-24-2011, 12:10 PM
  5. Unique Large Values From Duplicate List
    By S M C in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 10-04-2011, 02:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •