+ Reply to Thread
Results 1 to 11 of 11

VBA Lookup to Find/Display All Members in a Team

  1. #1
    Registered User
    Join Date
    10-15-2013
    Location
    Scotland
    MS-Off Ver
    Microsoft 365
    Posts
    71

    VBA Lookup to Find/Display All Members in a Team

    Hi.

    I have a table containing staff member names (column A), team they belong to, which is numbered between 1 to 30 (column B) and contact info / location info in columns C and D. The whole range is A4:D434.

    What I'd like to do is enter a name in A1 and then display a list of the other staff members who belong to the same team. I'll display this in a Userform.

    So, for example, if A1 contains "Joe Bloggs" and Joe is in team 3, I want to display a pop up (Userform) that shows everyone else in team 3, along with their contact info/location:

    I.e. it might look like this:

    Team 3 members -

    Joe Bloggs 01234 567890 London
    John Smith 09876 543210 Edinburgh
    Jane Doe 07070 135790 New York

    Any help with the VBA would be appreciated...

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: VBA Lookup to Find/Display All Members in a Team

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-15-2013
    Location
    Scotland
    MS-Off Ver
    Microsoft 365
    Posts
    71

    Re: VBA Lookup to Find/Display All Members in a Team

    Hi Alan.

    Please accept my apologies for the oversight; I meant no disrespect. My intention was only to try and increase the number of people who might be able to help. However, after reading the "cross posting" article, I see now how this could be construed as discourteous and will ensure that I do not make this mistake again.

    However, I have attempted to post a link but I just get an error saying that I am "...not allowed to post any kinds of links, images or videos..." until I've posted a few times...

    This is the link I was attempting to provide (minus the www bit): "mrexcel.com/forum/excel-questions/1099259-finding-listing-all-members-team.html#post5285176"

    Kind regards.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: VBA Lookup to Find/Display All Members in a Team

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Registered User
    Join Date
    10-15-2013
    Location
    Scotland
    MS-Off Ver
    Microsoft 365
    Posts
    71

    Re: VBA Lookup to Find/Display All Members in a Team

    Hi bakerman2.

    I've copy/pasted some details in to a new workbook to give a rough idea of what I was looking to achieve.

    Thanks for looking at this.
    Attached Files Attached Files

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: VBA Lookup to Find/Display All Members in a Team

    For starters.

    Advanced Filter method.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by bakerman2; 05-30-2019 at 09:30 AM. Reason: Added code

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: VBA Lookup to Find/Display All Members in a Team

    Other method. Filter in ListBox.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    10-15-2013
    Location
    Scotland
    MS-Off Ver
    Microsoft 365
    Posts
    71

    Re: VBA Lookup to Find/Display All Members in a Team

    Hi bakerman2.

    Both solutions work perfectly but I like the 2nd one as it's easier for me to understand. I have now added this to the main workbook and it works great. Thank you so much for taking the time to help with this.

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: VBA Lookup to Find/Display All Members in a Team

    You're welcome and thanks for rep+.

    PS:
    2nd method (ListBox Filter) is OK to use as long as your data doesn't exceed about 3K rows. After that it might start to lag and it's better to use 1st method (Advanced Filter)
    Last edited by bakerman2; 05-31-2019 at 04:22 AM.

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: VBA Lookup to Find/Display All Members in a Team

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Registered User
    Join Date
    10-15-2013
    Location
    Scotland
    MS-Off Ver
    Microsoft 365
    Posts
    71

    Re: VBA Lookup to Find/Display All Members in a Team

    Hi bakerman2.

    The list will not exceed 420-ish rows so the 2nd method is fine.

+ 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. [SOLVED] vba code to distribute account to team members
    By xlhelp7 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-29-2015, 06:17 AM
  2. Spread workload evenly to team members
    By Maja77 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-14-2015, 11:44 AM
  3. [SOLVED] Counting the members of a team
    By fgruhlke in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-22-2015, 12:39 PM
  4. Total Team Members with correct Team Leader
    By PrimalByte in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-05-2015, 04:23 PM
  5. Sampling Without Replacement- 10 Unique Team Members from 27
    By clattenburg cake in forum Excel General
    Replies: 5
    Last Post: 05-23-2014, 04:50 AM
  6. Greetings to all Excel Forum Team Members.
    By kkmishra009 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-20-2012, 09:45 AM
  7. Lookup Team, Return Members and Data
    By splash in forum Excel General
    Replies: 4
    Last Post: 04-08-2008, 11:38 AM

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