jrobin5881
Technical User
I have a Workbook with 5 spreadsheets listing items that can be ordered by the departments in my office. The total number of items are multiplied by their cost and that figure is linked to an invoice sheet.
Here's my issue: on the invoice sheet Cells H6, H16 and H26 have a sum formula. If the amount in any of those cells exceed $10,000 then I want a message box to appear telling my user to select another vendor. I tried several different methods including looping through the cell values and cannot seem to get it to work. Here is the code I'm using.
Here's my issue: on the invoice sheet Cells H6, H16 and H26 have a sum formula. If the amount in any of those cells exceed $10,000 then I want a message box to appear telling my user to select another vendor. I tried several different methods including looping through the cell values and cannot seem to get it to work. Here is the code I'm using.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
For Counter = 6 To 26
Set curcell = Worksheets("Invoice").Cells(Counter, 8)If Abs(curcell.Value) > 10000 Then MsgBox "Your request exceeds $10,000. You must reduce the number of items or use UNICOR as the vendor for the products requested", vbExclamation
Counter = Counter + 10
Next Counter
End Sub