Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Saving a column of IDs as a List

springwater14springwater14 Posts: 1Member
I am very new at this so this question may sound elementary but I could really use some help.

I have a code that will be used with another program. One part of the code is variable, the user has to input the ids of the person they will be looking up. Everyday the user will paste new info onto a worksheet. I want to make a button that will make a user form pop up with the code already filled out with all of the variable information.

More Details:
The IDs needed for the code will always be pasted into Column C, starting at row 2. The length will always be different.
I need the column of IDs to be saved into a list, concatenated with commas separating each id. Then I will reference this list in the code so the user doesn't have to manually change the code everyday.

The only thing I am having trouble with (so far) is saving the IDs that are in columns as 1 concatenated string.

I appreciate any help, thanks.

Comments

  • zibadianzibadian Posts: 6,349Member
    : I am very new at this so this question may sound elementary but I
    : could really use some help.
    :
    : I have a code that will be used with another program. One part of
    : the code is variable, the user has to input the ids of the person
    : they will be looking up. Everyday the user will paste new info onto
    : a worksheet. I want to make a button that will make a user form pop
    : up with the code already filled out with all of the variable
    : information.
    :
    : More Details:
    : The IDs needed for the code will always be pasted into Column C,
    : starting at row 2. The length will always be different.
    : I need the column of IDs to be saved into a list, concatenated with
    : commas separating each id. Then I will reference this list in the
    : code so the user doesn't have to manually change the code everyday.
    :
    : The only thing I am having trouble with (so far) is saving the IDs
    : that are in columns as 1 concatenated string.
    :
    : I appreciate any help, thanks.
    :
    :
    I assume you're working with some spreadsheet program. You can perform this without needing VBA. With this simple worksheet function you can concatenate the column into a string:
    [code]
    C D
    ID1 =C1
    ID2 =D1&","&C2
    ID3 =D2&","&C3
    ID4 =D3&","&C4
    ID5 =D4&","&C5
    ID6 =D5&","&C6
    [/code]
    The concatenated string is listed in the last field.
    Here's the code, if you want to adjust for blanks:
    [code]
    =D1&IF(C2="","",","&C2)
    [/code]
Sign In or Register to comment.