+ Reply to Thread
Results 1 to 3 of 3

Run a macro after selecting an employee from Drop-down list

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    Washington, DC
    MS-Off Ver
    Excel 2003
    Posts
    2

    Post Run a macro after selecting an employee from Drop-down list

    Good Morning,

    I am trying to create a Macro that will run when I select an employee from a Drop-down list.The drop-down list contains 21 employees and I need the macro to auto-fill their schedule into the first row of my spreadsheet when selected. Currently when I select an employees name it auto-fills 6 rows of the spreadsheet with Data using VLOOKUPS. I need to copy the formatting of the Schedule information, which is why I have not used a VLOOKUP for this data as well. I have been able to write a simple VB code for the first employee, but it remains stagnant when the next employee is selected. Can I assign a Range to each employee with several different codes since the row and columns will stay the same on my spreadsheet or do I need a separate Macro for each employee in the drop-down?

    The code I am currently using is below:

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 07-30-2013 at 09:59 AM. Reason: Added CODE tags, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help creating a Macro that will run after selecting an employee from Drop-down list

    We would have to see this workbook to guess at the code accurately. Your macro is going to have to:

    1) ...be built into a Worksheet_Change even macro stored in the sheet module so it triggers itself
    2) ...detect the change to the correct cell(s) before triggering
    3) ...find the name selected in the other sheet before copying the needed cells and formatting.


    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    Washington, DC
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Run a macro after selecting an employee from Drop-down list

    I have uploaded a scaled down version of my workbook due to confidential information. The critical pieces are still present. The Master tab contains the line I am trying to fill with the Macro (Row 5) and the Attendance tab is where the schedule is currently located. The drop-down is located in Row 2 on the Master tab.

    Please let me know if you need any additional information.

    Thanks!
    Attached Files Attached Files

+ 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] Selecting Drop Down List Menu
    By rlee12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2013, 06:16 PM
  2. Selecting Checkboxes using Drop Down List
    By neerajdwivedi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2013, 06:44 AM
  3. Replies: 3
    Last Post: 04-16-2012, 10:14 PM
  4. [SOLVED] Selecting Checkboxes using Drop Down List
    By 3dpilot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2010, 10:46 AM
  5. Selecting a line from a drop-down list
    By Jonibenj in forum Excel General
    Replies: 4
    Last Post: 12-11-2005, 01:46 PM

Tags for this Thread

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