+ Reply to Thread
Results 1 to 3 of 3

macro conditional copy and paste

  1. #1
    Registered User
    Join Date
    09-24-2010
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    2

    macro conditional copy and paste

    (revised)

    Hi,

    I want to write a macro in book1 for the following situation.
    I have two workbooks 1 and 2.
    I want to match "ID" on wb2 with "ID" on wb1. When found, copy "Sales" and "Tracking" to wb2's matching row. Then, extract name from "Sales" to "Who" on wb2.
    Next, if "status" is Poor on wb1, then Bad on wb2. if "status" is OK on wb1, then Good on wb2.
    Lastly, if "Who" is Sam, copy "Size" from wb1 to "Sam's Size" to wb2.


    Please help. I did lots research online. But I just don't know programming enough to be able to do this. Thanks so much. Below are wb1 and wb2.

    wb1
    ID Sales Tracking Status Size
    A 0901Mary000 321 Poor
    D 0901Sam000 322 OK L


    wb2
    ID Sales Tracking Who Satus Sam's Size
    B
    D 0901Sam000 334 Sam Good L
    C
    A 0901Mary000 321 Mary Bad
    Z
    N
    O
    Attached Files Attached Files
    Last edited by Langpu_LC; 09-27-2010 at 11:45 AM. Reason: added dummy data

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: macro conditional copy and paste

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Registered User
    Join Date
    09-24-2010
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: macro conditional copy and paste

    Thanks davesexcel for the advises.

+ 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