+ Reply to Thread
Results 1 to 4 of 4

Merge cells depending on number of other cells

  1. #1
    Registered User
    Join Date
    04-19-2011
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    30

    Merge cells depending on number of other cells

    Hello people,

    I would very much like to create a mergecells-macro.
    First a short description of my case. I have choosen to "dummy" it a bit so its easier for me to explain, so don't be fooled by the low number of input data and so :-)

    I have 2 columns, person and task(s). (One person might have several tasks)
    In one sheet (Sheet2) the person writes his name in column A and his tasks in column B ie:

    A -------- B
    Ben ----- Clean
    ------------Wash
    ------------Cook

    Now I would very much like to have a macro, that cut/paste this data into another sheet (Sheet1) - the "overview" sheet. I have made a macro that does this, but now I would like to make a macro that merges the cells in column A so that it fits the height of the 3 tasks in column B.

    How is this done? Can't seem to find a macro that "counts" the number of cells to merge from another column. And if I could get it to count it, how can I tell the macro what NUMBER of cells below it should merge?

    I hope it makes just a little sense and I hope that someone can help me.

    Thanks in advance

    Br
    Fred

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge cells depending on number of other cells

    hi, Fred, that's not exactly what you asked for but may be you will accept it as a good substitution, check attachment, press "Start" button
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-19-2011
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Merge cells depending on number of other cells

    Hmm it doesn't seem to solve my problem? I only have the name one time :-(

    Any other takers?

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Merge cells depending on number of other cells

    hi, FrederikBjerre, please check attachment, run code "test"

    PS. In order to avoid any misinterpretations of your task it's recommended to post sample workbook showing original data and the result you need to obtain
    Attached Files Attached Files

+ 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