+ Reply to Thread
Results 1 to 11 of 11

Smart Merging

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Smile Smart Merging

    I'm trying to right a piece of code that merge the contents of 'column B'
    were the contents of 'column A' is repeated.

    I've attached my code below but unfortunately the Offset by one action does not work for me as there can be varios numbers of cells with the sage info.

    I've attached an example dats/result set.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by TonyforVBA; 10-07-2011 at 11:48 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Smart Merging

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Smart Merging

    If you want to use VBA you should refrain from merging cells (VBA doesn't like them).

    An alternative

    Please Login or Register  to view this content.
    PS Unfortunately I wasn't able to detect any 'sage' info in the file
    Last edited by snb; 10-07-2011 at 06:39 AM.



  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Smart Merging

    I agree, in this instance with snb, there is no such thing as "smart merging" of cells.

    However this would appear to do as you ask
    Please Login or Register  to view this content.
    Your sample sheet seems to have data validation lists in Column B.
    Have a look at "Sheet1 (2)", does the formula solution do what you are after?
    (Just a guess.)
    Attached Files Attached Files
    Last edited by Marcol; 10-07-2011 at 07:10 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  5. #5
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Smart Merging

    Thanks for you help with that lads. I've got what I neede to get done. Saved me alot of hassle.
    Cheers

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Smart Merging

    Are you going to let us into the secret? What saved you a lot of hassle.

    Note
    You have started 57 threads since you joined the forum, and only one has been marked [SOLVED]. Are all the others unsatisfactory answers?

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

    Re: Smart Merging

    The only smart merging is no merging!!
    Hope that helps.

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

    Free DataBaseForm example

  8. #8
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Smart Merging

    Hey guys, Sorry I wasnt aware we had to apply a solved status to the threads ourselves I taught it was taken care of my the forum moderators. I'll be sure to do this future.

    HOwever . . . I have run into abit of a snag! altough the below code has worked in the tests I carried out it does not appear to work on the spreadsheet I need it for. No error messages, it just merges the wrong cells by the look of things. Would one of you guys mind taking a look, I may be missing somthing quite simple here.

    I've attached a copy of the spreadsheet Im working on, with irrelevant content removed.
    Cheers

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Smart Merging

    Sorry, just realised I forgot to attach the file.
    Attached Files Attached Files

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Smart Merging

    Your data in column "F" must be sorted for this to work.

    If you can't sort the data for any reason, I suggest you forget about merging cells to get the end result you are looking for, it will cause you all sorts of trouble later.

    Merging Cells in Data Tables is a practice to be strongly discouraged.

  11. #11
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Smart Merging

    Thanks Marcol, I actually copped this shortly after putting up the post.
    Thanks for you help on this. I'll be sure to mark this as solved.

    Enjoy your weekend!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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