+ Reply to Thread
Results 1 to 6 of 6

HELP - Combining the functionalities of two codes

  1. #1
    Registered User
    Join Date
    12-28-2016
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2016
    Posts
    3

    HELP - Combining the functionalities of two codes

    Hi,

    I wanted to combine the functionalities of two codes that i found over the internet. I am not a VBA coder, so I'm unable to do it myself. I would be very grateful if anyone could help. I've pasted the codes below - (source: www.contextures.com)

    Code 1 -

    Please Login or Register  to view this content.
    -----------------------------------------------------------------------

    Code 2 -

    Please Login or Register  to view this content.
    ---------------------------------------------------------------------
    Last edited by AliGW; 12-28-2016 at 04:48 AM.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: HELP - Combining the functionalities of two codes

    What exactly do the two Subs do? Its never straight forward to just merge two subs as there can be conflicts between IF statements etc.
    If someone has helped you then please add to their Reputation

  3. #3
    Registered User
    Join Date
    12-28-2016
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: HELP - Combining the functionalities of two codes

    Both code lets the user select multiple values from a data validation list in the same cell.

    Code 1 - It also lets the user remove a value when the user clicks on the value "again" from the list.

    Code 2 - It also lets the user double click on the cell and enter a value, *without creating a duplicate of the entire string* (In code 1, if i allow users to enter their own data apart form the validation list, it creates and copy of the new string, adds to the end of the old string and the combined new string gets entered)

    I hope I'm able to make it clear.
    Last edited by AliGW; 12-28-2016 at 04:50 AM. Reason: Extraneous quotation removed.

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: HELP - Combining the functionalities of two codes

    So in its most basic form you want the functionality in Code 1 with the addition of of letting the user "double click on the cell and enter a value, *without creating a duplicate of the entire string"?

  5. #5
    Registered User
    Join Date
    12-28-2016
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: HELP - Combining the functionalities of two codes

    Yes, Exactly.

    The main requirement is -
    "Being able to select multiple items/values from a data validation list and the value gets stored in the same cell. With each item/value separated by a comma as the user keeps selecting new items/values"

    With the following conditions -
    1. User must be able to remove a specific value and must not require clearing the entire cell
    2. User must also be able to manually enter values by double clicking on the cell. It should not result in a copy of the values getting generated again
    3. Items/values must NOT repeat once the user has already selected it

    In case there is a better way/technique of fulfilling the requirement without using VBA or data validation list, I'm always open to suggestions.
    Last edited by AliGW; 12-28-2016 at 04:50 AM. Reason: Extraneous quotation removed.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,536

    Re: HELP - Combining the functionalities of two codes

    @Boris_L - your opening post did not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    I have done it for you this time, but in future, please do it yourself. Thanks!

    Also, please don't quote other posts unnecessarily.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Combining 2 codes into 1.
    By mullet40 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2016, 01:31 PM
  2. Call Two Codes from ComboBox
    By zplugger in forum Excel General
    Replies: 2
    Last Post: 01-24-2015, 03:02 PM
  3. Combining 2 VBA codes
    By watiwawa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-09-2014, 02:20 AM
  4. combining two vba codes into one
    By Ironman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-16-2013, 01:52 AM
  5. Combining vba codes makes the previous codes broken !
    By MDPLUS in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-26-2013, 10:00 AM
  6. [SOLVED] Combining 2 codes?
    By bjcowen9000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2013, 02:48 PM
  7. Combining two VBA codes
    By kimokurt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2011, 10:05 AM

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