+ Reply to Thread
Results 1 to 6 of 6

Error Checking using offsets as Formulas

  1. #1
    Registered User
    Join Date
    02-12-2013
    Location
    Essex
    MS-Off Ver
    Office Professional Plus 2010
    Posts
    21

    Error Checking using offsets as Formulas

    Hi Guys,

    Having a bit of trouble with some code im trying to implement...

    What im trying to have it do, is check that cell "G20" is equal to "A20 * F20"... now i can do that, but now comes the fun part...

    in each of those coloumns there are about 6/7 different values, i need to check each row, one by one... if that makes sense?
    thought id add, the values in column A are quantities, column F are unit prices and column G are the net prices... obviously i need to make sure that the net price is the same as the unit price * quantity... wow i hate explanations! hahaha!

    ill attach the code, that should make alot more sense. if you need the spreadsheet attached to, let me know and ill put up a "cut down" version...

    Please Login or Register  to view this content.
    thanks in advance! u guys are awesome here!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error Checking using offsets as Formulas

    Is the code not working?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    02-12-2013
    Location
    Essex
    MS-Off Ver
    Office Professional Plus 2010
    Posts
    21

    Re: Error Checking using offsets as Formulas

    no it keeps telling me that they are all unit prices even when they are not... why should that work then? would it help if i uploaded the sheet?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error Checking using offsets as Formulas

    I think I know what the problem is, but it might be good to see the worksheet.

    In this line of code you are comparing the value from Item to the string "sum(Item.Offset(0, -1)) * (Item.Offset(0,-6))"
    Please Login or Register  to view this content.
    Don't know why but I've got a feeling that might return false.

    Try replacing with this.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-12-2013
    Location
    Essex
    MS-Off Ver
    Office Professional Plus 2010
    Posts
    21

    Re: Error Checking using offsets as Formulas

    ahhh now that works... but its backwards :| but i think thats my fault, i need to make it check if there "not" the same then mark red and throw up a message box...
    this is what ive come up with - not very imaginative i know but.... IT WORKS!

    Please Login or Register  to view this content.
    Norie, you are once again a life saver! apparently i havent got my head round quite as many of these syntax's as i had thought.

    the original code never threw up any errors, its just didnt do anything if there were errors (which i specify)... but im there! i think that was your code originally wasnt it Norie?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error Checking using offsets as Formulas

    What 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