macro

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

I need help............
I am trying to get a macro to for the following problem:

there are 4 lines of information spanning from ("A9:AG12"). Columns A
through AF are properties from a test. Each row is a seperate test. Column
AF is the date.

If any two consecutive tests are outside the specific tolorance then the
production of the material must stop unless the date("AF") is different.
 
For RowCount = 9 To 11
If Range("AF" & RowCount) = Range("AF" & (RowCount + 1)) Then
For ColCount = 1 To Range("AE" & RowCount).Address
If ((Cells(RowCount, ColCount) > MaxTol) Or _
(Cells(RowCount, ColCount) < MinTol)) And _
((Cells(RowCount + 1, ColCount) > MaxTol) Or _
(Cells(RowCount + 1, ColCount) < MinTol)) Then

MsgBox ("Data is out of Range")
End If
Next ColCount
End If

Next RowCount
 
Back
Top