+ Reply to Thread
Results 1 to 6 of 6

Extract data from one worksheet to another based on selection in drop-down menu

  1. #1
    Registered User
    Join Date
    09-20-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    3

    Extract data from one worksheet to another based on selection in drop-down menu

    Hi all,

    I am completely new to VBA and am trying to resolve this problem. Basically, I have an excel sheet with 3 worksheets named "Trains", "Selection" and "Station". In the "Trains" worksheet, I have the fare information for 4 types of train. In the "Selection" worksheet, I have drop down menus where I can select the train type for Station 1 to Station 5. Based on my selection of train for each station in "Selection" worksheet, I would like to auto-populate the "Station" worksheet by extracting the fare information from the "Trains" worksheet. How can I go about doing this ? Any advice would be greatly appreciated.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Extract data from one worksheet to another based on selection in drop-down menu

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your "Selection" sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make your selection from any of the drop downs.
    Please Login or Register  to view this content.
    "Station 5" in cell F4 in the "Selection" sheet has a blank space at the end. Please remove this blank space otherwise the macro will return an error.
    Last edited by Mumps1; 09-20-2017 at 11:07 AM.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    09-20-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    3

    Re: Extract data from one worksheet to another based on selection in drop-down menu

    Thank you so much. I really do appreciate it. Now to figure out how this code works.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Extract data from one worksheet to another based on selection in drop-down menu

    Here is the code with some explanatory comments. I hope this helps.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-20-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    3
    Quote Originally Posted by Mumps1 View Post
    Here is the code with some explanatory comments. I hope this helps.
    Please Login or Register  to view this content.
    Thank you Sir!

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Extract data from one worksheet to another based on selection in drop-down menu

    My pleasure.

+ 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. Populate Worksheet from Drop Down Menu Selection
    By warrior6627 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-01-2014, 02:57 PM
  2. Locking a cell based on drop down menu selection (Protected Worksheet)
    By DRogersICF in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-30-2014, 03:52 PM
  3. Replies: 3
    Last Post: 01-31-2013, 06:22 PM
  4. Replies: 9
    Last Post: 01-30-2013, 01:25 PM
  5. [SOLVED] How to reference/populate a column of data based on a drop down menu selection
    By walterst in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-13-2012, 07:11 PM
  6. Drop Down Menu Selection & New Value Worksheet based on Cell
    By shelton_4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-15-2012, 09:46 PM
  7. Hide a row based on a drop down menu selection
    By AMechEng in forum Excel General
    Replies: 4
    Last Post: 06-20-2012, 03:57 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