Excel Hints

Results 1 to 1 of 1

Thread: Copy and paste in VBA

  1. #1

    Copy and paste in VBA

    Hi,

    I am new to VBA and some help with 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:
    A	        B	        C
    Filing Date	Company Name	Revenue
    1/1/2000	ABC, Inc.	1234
    4/14/2008	FGH, Inc.	5678
    4/6/2005	DEF, Inc.	5664
    7/7/1999	ABC, Inc.	1356
    5/8/2010	XYZ, Inc.	6456
    5/8/2010	ABC, Inc.	3213
    1/23/2005	FGH, Inc.	8546
    4/5/2006	FGH, Inc.	2133
    12/25/2010	ABC, Inc.	5466
    11/13/2010	ABC, Inc.	5465
    Sheet 2: "ABC, Inc." is selected in the drop down menu in cell B2:

    HTML Code:
    B
    Drop Down
    ABC, Inc.
    After the macro fires, the result on sheet2 is:
    HTML Code:
    E	        F	        G
    Filing Date	Company Name	Revenue
    1/1/2000	ABC, Inc.	1234
    7/7/1999	ABC, Inc.	1356
    5/8/2010	ABC, Inc.	3213
    12/25/2010	ABC, Inc.	5466
    11/13/2010	ABC, Inc.	5465
    If I need to be more specific or provide any additional information please let me know. I am indeed new to VBA.

    Thanks!
    Attached Files Attached Files
      To view attachments your post count must be 0 or greater. Your post count is 0 momentarily.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •