+ Reply to Thread
Results 1 to 3 of 3

Help with Excel Macro

  1. #1
    Registered User
    Join Date
    11-29-2011
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Help with Excel Macro

    Hi,

    I am new to VBA and some help creating a macro would be great! Attached is data that models my problem. Ideally, I would like the macro to recognize the value in the drop down menu in sheet2 cell B2 and pull in the corresponding data associated with that value from sheet1. Ideally, the macro would copy and paste the data in sheet1 to sheet2 to match the column headings for that particular value in sheet2 cell B2. So for example:

    Sheet 1: Data set

    HTML Code: 
    Sheet 2: "ABC, Inc." is selected in the drop down menu in cell B2:

    HTML Code: 
    After the macro fires, the result on sheet2 is:

    HTML Code: 
    If I need to be more specific or provide any additional information please let me know. I am indeed new to VBA.

    Below is the code that is currently in Sheet2. I know it is wrong, but maybe you guys could help me tweek it to make it work properly according to what I laid out above:

    HTML Code: 
    Thanks very much!
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Help with Excel Macro

    Try this example...

    Change the value in B2 on sheet 2

    Edit: Sorry lost my marbles for a few minutes. Can you take a few minutes and read the forum rules about thread titles. Please update accordingly.
    Attached Files Attached Files
    Last edited by jeffreybrown; 11-29-2011 at 09:16 PM.
    HTH
    Regards, Jeff

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Help with Excel Macro

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST

+ Reply to 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