+ Reply to Thread
Results 1 to 10 of 10

Merging Cells

  1. #1
    Registered User
    Join Date
    07-30-2007
    Posts
    61

    Merging Cells

    Hi

    I have a column with data, the cells go data, blank cell, data, blank cell, data etc.

    The row count will vary.

    What I need to do is go through the non blank cells in the column and merge the them with the blank cells beneth them.

    ie A2 = Apple
    A3 = blank
    A4 = Pear
    A5 = blank

    run the code to get

    A2 and A3 = Apple
    A4 and A5 = Pear

    Thanks
    Last edited by roasty_1; 01-19-2009 at 05:09 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Link should help to fill the blanks

    http://www.contextures.com/xlDataEntry02.html

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Don't merge cells, you will experience problems eventually
    Hope that helps.

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

    Free DataBaseForm example

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Quote Originally Posted by royUK View Post
    Don't merge cells, you will experience problems eventually
    Roy,

    I read it as the OP needs to fill blanks

    VBA Noo

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I thought the OP wanted to merge the cells to one

  6. #6
    Registered User
    Join Date
    07-30-2007
    Posts
    61
    Thanks for the answers

    Merging the cells are ok for this excerise, so I will stick with them

    Excel file attached to show what I mean.

    The list could change length so I would need to add a piece of DO LOOP code
    Attached Files Attached Files

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    As Roy suggests you should avoid merge cells.

    If you must then try

    Please Login or Register  to view this content.
    VBA Noob

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Just to add my voice to Roy's, merging cells is a uniformly bad idea if there is any downstream dependency - formulas, VBA, anything.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Registered User
    Join Date
    07-30-2007
    Posts
    61
    thanks, I will give this a go

    the cells that are to be merged are static data, just headings.

    Cheers all

  10. #10
    Registered User
    Join Date
    07-30-2007
    Posts
    61
    VBA Noob

    sorted

    thanks

+ 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