+ Reply to Thread
Results 1 to 5 of 5

Thread: cross comparing on a spreadsheet not finding values

  1. #1
    Registered User
    Join Date
    04-23-2010
    Location
    Albuquerque, USA
    MS-Off Ver
    Excel 2007
    Posts
    21

    Post cross comparing on a spreadsheet not finding values

    I am having problems with this spreadsheet. I am trying to cross compare 3 spreadsheets to find out if an invoice is paid and if the billing matches the invoice. I have attached the file but I can't figure out how to get it to work. Could someone let me know if there is a better way of doing this or if it is possible?
    Attached Files Attached Files
    Last edited by mdnghtsnpr; 04-28-2010 at 12:42 PM. Reason: solved

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & read 2007
    Posts
    15,979

    Re: cross comparing on a spreadsheet not finding values

    Hello mdnghtsnpr,

    Since the worksheet "Paid" is empty, I am assuming you want to check the worksheets "DCN-log" and "Invoice" against each other to determine if the invoice was paid. If it has been paid then the information from those worksheets would be copied over to "Paid".

    What isn't clear is how you are determining when an invoice is paid. Which columns on which sheets are compared to determine the invoice is paid? Please provide a more detailed and clear explanation of what you want to do.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-23-2010
    Location
    Albuquerque, USA
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: cross comparing on a spreadsheet not finding values

    column "A" on "Invoice" looks at column "A" on "Paid" and if match found it is suppost to highlight the cell yellow.
    For b = 2 To DesCount2
    
    If Workbooks(DesFile).Sheets("Invoice").Range("A" & d).Text = Workbooks(DesFile).Sheets("Paid").Range("A" & b).Text Then Call Update_Cell(DesFile, "A", a)
    
    Next b
    Next a

  4. #4
    Registered User
    Join Date
    04-23-2010
    Location
    Albuquerque, USA
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: cross comparing on a spreadsheet not finding values

    I figured it out. I have to simplify the if statements with else goto's for it to work thanks for the help.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & read 2007
    Posts
    15,979

    Re: cross comparing on a spreadsheet not finding values

    Hello mdnghtsnpr,

    Still working on this. Part of the problem is you are using the ampersand "&" as the logical operator "AND". Not the same the animal. The ampersand is used for concatenation of strings only. You must use "AND" for logical comparisons.

    I am adding object variables to the macro. This will help in two ways. One is to eliminate the "spaghetti code" and the second is provide more flexibility.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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.2.0