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...
Sub Unit_Check()
Dim Item As Variant
Dim Group As Range
Dim ctrErrors As Integer
Set Group = Range("G20,G21,G22,G23,G24,G25,G26")
'check for error
For Each Item In Group
If Item.Value = "sum(Item.Offset(0, -1)) * (Item.Offset(0,-6))" Then
Item.Offset(0, -1).Interior.Color = RGB(255, 0, 0)
ctrErrors = ctrErrors + 1
Else
Item.Offset(0, -1).Interior.Color = xlNone
End If
Next Item
'send msgbox
If ctrErrors > 0 Then
MsgBox "The " & ctrErrors & " items in RED are not unit prices. Please Adjust accordingly"
cancel = True
Else
MsgBox "Please Continue"
End If
End Sub
thanks in advance! u guys are awesome here!
Bookmarks