+ Reply to Thread
Results 1 to 2 of 2

Macro that compares two spreadsheets and copies to 1

  1. #1
    Registered User
    Join Date
    03-09-2011
    Location
    utah, usa
    MS-Off Ver
    excel 2007
    Posts
    23

    Question Macro that compares two spreadsheets and copies to 1

    I need a macro to compare two excel files called old pricing & new pricing, on column c on both spreadsheets it has a column name alu. I need the macro to match alu (data below the alu column) for each spreadsheet. There will also be on column f (cost) and column g (price). If the alu matches it will do several functions.

    1) it will only copy from old pricing to new pricing if new cost & price = 0 or blank.
    2) it won't copy if new pricing already has a price for cost or price above 0
    3) it will only change new pricing and not change old pricing
    4) Pull from a file and not a worksheet
    4) The result will be new pricing changed if the following criteria above is followed

    Example: Is attached (Note: attached example on the tab old pricing & new pricing should be two separate files) Also the result is just an example of the replaced new pricing should be.

    based on the result tab on the attached file example

    On the result old pricng f2 & g2 replace new pricing f2 & G2 because they were 0's. On the result old pricing f3 & G3 were 0's so it didn't replace f3 & g3 pricing on new pricing and new pricing already had a price above 0 so it stayed the same and no change. On the result old pricing f4 & g3 because new pricing already had pricing above 0 the pricing stayed the same even though there were different prices from the old pricing.

    So the bottom line is if there is a 0 or blank on new pricing and the old pricing has a price above 0 then change it. If old pricing has a price and new pricing has a price don't change it because new pricing is above 0 already. (blank is = 0, and new pricing is all that need to be changed)

    i had someone help me on another forum, we came close but just didn't quite get it.

    i appreciate any help, and thanks in advance
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Macro that compares two spreadsheets and copies to 1

    Welcome to The Forum!

    Quote Originally Posted by ucsutah View Post
    i had someone help me on another forum, we came close but just didn't quite get it.
    Please review the forum rules (see menu bar above), and see rule #8. If you post the same question somewhere else, you are asked to post a link to it.

    You are asking us to start from scratch here when apparently there's been a lot of work done, and perhaps useful work. Please post a link that will show the code that was developed so far.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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