+ Reply to Thread
Results 1 to 2 of 2

VBA copy data to another worksheet based on criteria

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    S
    MS-Off Ver
    Excel 2011 Mac
    Posts
    1

    VBA copy data to another worksheet based on criteria

    Hi all
    I'm pretty new to the VBA world and looking for a little help. What I like to accomplish is the following:

    I have a master workbook on sheet 1 with two macros attached to buttons and sheet 2 (Category Table) with two columns: "Codes" & "Department" (20 records).

    I'm trying to create a new macro which should open an excel file (Category.xls) with around 30,000 records and copy/paste the codes from the category table into column A in Category.xls. Column A is for Codes and Column B is description. Many of the description names match with the department names in the category table, but the codes show "0" and I want to copy the real code. For the items that do not match with the category table and has a "0" in the "Codes" column, I want to delete the entire row. Attachment 197111Attachment 197112

    Hope I'm not making it too confusing.

    Thanks for reading and I appreciate any help.
    Last edited by wgaca07; 11-29-2012 at 02:53 PM.

  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: VBA copy data to another worksheet based on criteria

    Your attached pictures are unreadable. Please attach sample workbooks. In the samples, perhaps show BEFORE/AFTER sheets so we can see how it starts and how it should end, on a dataset of 10-20 rows.
    _________________
    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!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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