+ Reply to Thread
Results 1 to 14 of 14

Auto-population Troubles

  1. #1
    Registered User
    Join Date
    08-28-2011
    Location
    St. Louis
    MS-Off Ver
    Excel 2007
    Posts
    35

    Auto-population Troubles

    Good Morning Excel Experts,

    Hope this thread finds you well. I am trying to form an Excel Worksheet that will automate comments in one Column based upon what letter is entered into Column C. The formula I have so far is:

    =IF(C2="D","Account Requiring Assist Code Adjustment",IF(C2="E","Adjust Source Code",IF(C2="F","Adjust LM Counselor",IF(C2="G","Adjust Plan Type",IF(C2="H","Email Assigned Rep","")))))

    However, I am looking for a non-VBA way to have it where the user can enter multiple letters into Column C and have multiple comments appear.

    For Example, if Column C had D, E & H entered. The comments would appear as, “Account Requiring Assist Code Adjustment,” “Adjust Source Code,” and “Email Assigned Rep.”

    Would the entry method in Column C to obtain multiple comments need to be entered with a comma and no space? A semicolon and no space? A comma with a space?
    Last edited by dreinisch; 10-10-2012 at 12:57 PM. Reason: Solved

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Auto-population Troubles

    That would be very hard to do without VBA.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-28-2011
    Location
    St. Louis
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto-population Troubles

    That's what I gather. I've tried quite a few different ways to avoid it...
    Do you know how it could be done via VBA, shg?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Auto-population Troubles

    Please Login or Register  to view this content.
    The formula in D11 and copied down is

    =Catif(ISNUMBER(MATCH($A$2:$A$7, MySplit(A11), 0)), $B$2:$B$7)

    It MUST be confirmed with Ctrl+Shift+Enter rather than just Enter.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-28-2011
    Location
    St. Louis
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto-population Troubles

    shg,
    Would there be a way to do that so that the top few columns are not reserved for the source population of comments?
    Attached Files Attached Files

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Auto-population Troubles

    You can put the list anywhere you like.

  7. #7
    Registered User
    Join Date
    08-28-2011
    Location
    St. Louis
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto-population Troubles

    Okay. That sounds good. I can hide the top few columns (or bottom). I take the formula and paste it into the comments column (column D). Plug in the macro to VBA... when in use, with that macro...where would the letters be entered so that the comment would systemically appear? If that sounds like a n00b question, I do apologize. I am a novice when it comes to VBA. Hence, why I try to avoid it if at all possible.

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Auto-population Troubles

    Maybe I can help. In your spreadsheet, Where is your list of comments and what are they linked to (Letter item)? Might as well modify shg's UDF to match what you expect to use.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Auto-population Troubles

    Here is your sheet back with formula's set up for your sheet. There was no need to modify the code itself. As you said, you can hide the list if you want
    Questions?
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    08-28-2011
    Location
    St. Louis
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto-population Troubles

    Chemist B, I am sorry for the delayed response. I have been away from my computer for a few days. I attempted using the same formula...but end up with #NAME? and for the life of me....I cannot figure out why.
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Auto-population Troubles

    Excel does not recognize the functions "CatIf" and "MySplit". These are called UDF (User Defined Functions) which shg created with the code in Post #4. Here's what you need to do.

    In your workbook, hit ALT + F11 to open the VBA Editor. In that window, Insert > Module
    There will be a white text box on the right side of the window. Copy and paste shg's code from post #4 into that box
    Close the VBA Editor. (No need to save as the VBA will now be part of your workbook and will save with your workbook)

    Now Excel should recognize the names (Hit F9 to refresh if you need to). Did that help?

  12. #12
    Registered User
    Join Date
    08-28-2011
    Location
    St. Louis
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto-population Troubles

    I'm not sure how...but I've copied the code from item number 4 into VBA editor and ended up with all comments appearing without any entry into Column C.

    Letter Item Comment
    C Took too long
    D had a bad day
    E excellent job
    F huh?
    G Hello there
    H What's up?
    I Hamburger
    J Smart Phone
    K Hi to you

    DRI Account Number clerk name Letter Item Date Reviewed Comments
    12345 John Smith Took too long,had a bad day,excellent job,huh?,Hello there,What's up?,Hamburger,Smart Phone,Hi to you
    Attached Files Attached Files

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Auto-population Troubles

    Okay, we're getting there. Your formula is correct EXCEPT this is an Arrayed Function. That means that when you enter the formula, you need to hit CNTRL SHFT ENTER rather than a simple ENTER. If you do this properly you'll see brackets {} appear around your formula. You can then drag it down.

    I also note that shg's code doesn't like blank spaces between your comma's and entries so, rather than play with his code, I suggest we remove the blanks using SUBSTITUTE when we split it.
    your formula becomes

    =Catif(ISNUMBER(MATCH($A$2:$A$10, MySplit(SUBSTITUTE(C12," ","")), 0)), $B$2:$B$10)

  14. #14
    Registered User
    Join Date
    08-28-2011
    Location
    St. Louis
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto-population Troubles

    Hey!!!! That fixed it! It works!!!
    Thank you!!!!!!!!!!

+ 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