+ Reply to Thread
Results 1 to 7 of 7

Concatenation & Macro

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Concatenation & Macro

    Hi,

    I have a workbook that takes concatonated information and via a macro populates a student register with names in the cells adjacent to the concatonated ones..

    Two of the concatonated results that the macro uses are as follows:

    ADP-NUR-AD9/09AB3
    ADP-NUR-AD9/09AB3 - DABS 0001
    Students associated with ADP-NUR-AD9/09AB3 are populated correctly in the register. However the same running macro then mistakenly goes on to take all the students from ADP-NUR-AD9/09AB3 - DABS 0001 entry and populates them in the same register.

    It seems to be failing to recognise the text ' - DABS0001' after the text AB3 and realise that it's a different group of students.

    Curiously when producing a register for just the ADP-NUR-AD9/09AB3 - DABS 0001 students it does not take the ones from ADP-NUR-AD9/09AB3 and add them to the same register.

    Without me removing bundles of info and attaching a blank copy, can someone guess what might be happening here?
    Last edited by Barking_Mad; 02-22-2011 at 06:32 AM.

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

    Re: Concatonation & Macro

    hi, Barking_Mad, can you provide sample workbook showing original data and result you'd like to obtain?

  3. #3
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Concatonation & Macro

    Hi,

    Please see attached.

    1. On the 'List of Lessons' tab click in the first row to be printed and then on the big red button.

    2. Press cancel so you dont print and click back into the Register worksheet.

    3. You will see that it is taking the names of both groups of students when it should only be taking the ones from AB1.

    4. Look at the 'Names' worksheet and you'll see you the lists of students and the concatonated column that the info is used to grab the info from.

    5. The worksheet called 'Info' stores all the different names for the drop down menu lists.

    As i said above, the issue appears to be it fails to realise that

    ADP-NUR-AD9/09AB1


    and

    ADP-NUR-AD9/09AB1 - HECS 2073

    are different groups. If I take the space from between

    ADP-NUR-AD9/09AB1 - HECS 2073

    and turn it into

    ADP-NUR-AD9/09AB1-HECS 2073

    the problem seems to be solved, but without explaining why, this makes other problems for me!

    Hoep this makes sense, any question please feel free to ask! Also, the sheet seems to have developed a 'hang' and cells are slow to be clicked on, i presume this is something to do with the macro? Any suggestions?
    Attached Files Attached Files
    Last edited by Barking_Mad; 02-22-2011 at 08:15 AM.

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

    Re: Concatonation & Macro

    it's a bit of a problem to understand full logic, but try to change your "CreateRegister" code with:

    Please Login or Register  to view this content.
    That will replace " - " on sheet "Names" columns C and E with "-"

  5. #5
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Concatonation & Macro

    Thanks for your help. Im getting the following when pasting this back into my original copy and running the macro:

    Run-time effort '1004':

    Application-defined or object-defined error
    highlighting this bit of code:

    Please Login or Register  to view this content.

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

    Re: Concatenation & Macro

    let me get home today, I will test that on Excel 2007 though I do not see any possible troubles here

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

    Re: Concatenation & Macro

    try this out:
    Please Login or Register  to view this content.
    On sheet "Info" the data goes with spaces(AB1 - HECS 2073) in Group column so should be changed (AB1-HECS 2073). As far as I understand it's entered by hands.

+ 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