Consulting

Results 1 to 2 of 2

Thread: associate a list with a cell and get the selected value,using vba

  1. #1
    VBAX Newbie
    Joined
    Oct 2010
    Posts
    4
    Location

    associate a list with a cell and get the selected value,using vba

    Hi,
    I have a macro enabled excel sheet. i have a button in sheet2 of this file. My requirement is:

    1. when i click on the button in sheet2, i want to create a list which will have the values 'Item1','Item2' and 'Item3' and then i want to place this list in cell A1 of sheet1.
    2. when i select a particular value from this list in A1 of sheet1, i want to get the value is selected from this list.

    Is there any possible solution for the above. Please help.

    Regards,
    Anu

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Hi Anu,

    You want the whole list to go into A1? If so, define a string in your code to hold the values, which you might separate with spaces. Then, use your code to loop through the search range, adding each found value to the list. When you're finished with the loop, write the contents of your string to A1.

    If you have problems doing this, post the code to show what you're trying to do and someone here will probably be able to help you.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •