+ Reply to Thread
Results 1 to 7 of 7

VBS matching names and auto populating cell with associated year

  1. #1
    Registered User
    Join Date
    07-06-2011
    Location
    salem, or
    MS-Off Ver
    Excel 2010
    Posts
    11

    VBS matching names and auto populating cell with associated year

    Form Test.xlsmI am working from two worksheet.
    Collection Worksheet is an input worksheet where I type in the gathered information. Column D contains a drop down list of names.
    Information Worksheet contains list of student names (column e) and graduating year "Column D". I am able to accomplish this by using this formula =INDEX(Individualnames!$D$3:$D$24991,MATCH(D43,Individualnames!$E$3:$E$24991,0)) and manually filling the cells.

    I am new to programming a form. I have created a form to type in the collected information. I would like to populate a cell with the graduation year with the associated name.

    I have created a form with the program below. I am not sure how to program the above formula into the program. Can someone please help me.

    Thanks.


    Please Login or Register  to view this content.
    Last edited by alansidman; 10-27-2013 at 11:24 AM. Reason: Code tags added

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBS matching names and auto populating cell with associated year

    I don't really follow what you want done?

    If you're trying to determine the row number of the selected name in the Studentname combobox, you could use its selected item index number. Each item in the combobox list has an index number starting at zero. So if the second name is selected (index 1), and the combobox list is from cells starting at row 3, then the selected name's row is 4 (1 + 3)

    StudentNameRow = Studentname.ListIndex + 3
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    07-06-2011
    Location
    salem, or
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VBS matching names and auto populating cell with associated year

    I probably didn't explain it very well.

    I choose a student name from the drop down list on the form.
    The names comes worm worksheet 2. I want the information from the cell next to the name to populate a cell in worksheet (1)
    when I click the OK button.

    Thanks for any help.

  4. #4
    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,893

    Re: VBS matching names and auto populating cell with associated year

    Welcome to the forum
    Your post does 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.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added them for you this time. Please read our rules and adhere to them in the future.)
    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

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBS matching names and auto populating cell with associated year

    Hi nancytaylor

    Try the Code in the attached...it takes a bit to update because of all the lookups and formulas need recalculated.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Registered User
    Join Date
    07-06-2011
    Location
    salem, or
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VBS matching names and auto populating cell with associated year

    Thank you so much. YOU ROCK!!! It does exactly what I want it to do!!!!!

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBS matching names and auto populating cell with associated year

    You're welcome...glad I could help. Thanks for the Rep.

+ 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] re: auto-populating cell question
    By 4GONERS in forum Excel General
    Replies: 3
    Last Post: 07-05-2013, 10:03 PM
  2. [SOLVED] Cell not auto-locking after auto-populating
    By Hillster in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2012, 10:23 AM
  3. Auto Populating info (names) from one sheet to anthe-
    By LiveOnPurpose in forum Excel General
    Replies: 1
    Last Post: 05-24-2012, 12:56 PM
  4. Replies: 1
    Last Post: 05-02-2011, 10:09 PM
  5. Auto Populating A Cell
    By whensley in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-23-2011, 11:10 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