Closed Thread
Results 1 to 21 of 21

creating a drop down list for names and addresses

Hybrid View

gracious creating a drop down list for... 04-02-2008, 02:46 PM
Dunc3142 See if this works for you 04-02-2008, 04:06 PM
gracious wow, yes that is what I am... 04-02-2008, 06:32 PM
gracious I have been waiting for... 04-04-2008, 01:39 PM
darkyam VLOOKUP takes 4 arguments: a... 04-04-2008, 01:45 PM
ChemistB To answer some of your other... 04-04-2008, 02:27 PM
gracious Thank you so much for the... 04-04-2008, 03:23 PM
darkyam Do you mean you want the... 04-04-2008, 03:32 PM
gracious Yes I think that is correct,... 04-04-2008, 03:54 PM
darkyam Could you please post the... 04-04-2008, 03:57 PM
gracious oh, I see, the... 04-04-2008, 04:00 PM
  1. #1
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    VLOOKUP takes 4 arguments: a value to be looked up, an array to look it up in, the column to return from that array, and TRUE or FALSE (denoting either closest match without going over or exact match, can also be represented by 1 and 0).
    To take the Sara Johns example his workbook opens with, A2 starts by looking up Sara Johns on Addresses, column A, then returns the value in the second column once it finds a match.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    To answer some of your other questions, let's look at the formula in A2.
    =VLOOKUP(A1,Addresses!A2:G50,2,FALSE)&"   "&VLOOKUP(A1,Addresses!A2:G50,3,FALSE)&"  "&VLOOKUP(A1,Addresses!A2:G50,4,FALSE)&"  "&VLOOKUP(A1,Addresses!A2:G50,5,FALSE)
    Here Dunc is using the concatenate feature to string together a series of results from VLOOKUP (using &) with spaces inbetween them (&" "&). In order to put in a comma, instead of a space between the VLOOKUPs returning the Town and state, use &", "&

    To put the Fax # on it's own line (in it's own cell), Break up the formula in cell A3 into two cells.
    ="Phone "&VLOOKUP(A1,Addresses!A2:G50,6,FALSE)&"  FAX"&VLOOKUP(A1,Addresses!A2:G50,7,FALSE)
    Cut after the first "FALSE)" and put the second part into cell A4 beginning with an equals sign.

    There is no Sheet1 because Dunc renamed it Addresses and moved it to after Sheet2.

    ChemistB

  3. #3
    Registered User
    Join Date
    05-09-2005
    Posts
    18
    Thank you so much for the replies. I appreciate the explanations as well.

    Ok, so do I just highlight A2 and at the top input the code in the formula bar or do I have to do the vba F11? If my contractor lists has 20 names, do I just copy and paste the code but keep changing the number?

    One more thing, when it shows A2:G50, what does G50 refer to?

    Again, thank you so much for the help and info!!!!

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    Do you mean you want the lookup to occur 20 times on the page? If so, change the array reference to Addresses!$A$2:$G$50. As long as the lookup is just above the cells where the formulas are (i.e., each address appears in the same group format as it is now), you won't have to manually change anything else. G50 refers to the last cell in the lookup array. In other words, these formulas will try to match the name in A1 with the values in A2:A50 on the Addresses tab and can return any value from that array out to column G.

  5. #5
    Registered User
    Join Date
    05-09-2005
    Posts
    18
    Yes I think that is correct, when I look at his sheet, his vlookup strings, he has 2,FALSE and then 3,FALSE....I assumed because of the number of names.

    I tried putting in the code but all I got was #N/A
    Obviously I am not doing something correctly.

  6. #6
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    Could you please post the formula you used or the workbook?

  7. #7
    Registered User
    Join Date
    05-09-2005
    Posts
    18
    oh, I see, the 2,3,4,....refers to the columns in the addresses sheet,not to how many names there are! and the back to back is just adding a new value to the same line so that they appear next to each other, oofta!! Light bulb just came on.

  8. #8
    Registered User
    Join Date
    05-09-2005
    Posts
    18
    How do I upload the worksheet? I suppose I should remove the company name, bla bla first?

Closed 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