|
- Sub AutoCheck_THE_CERTIFICATE_OF_ANALYSIS()
- Dim r As Range
- With ActiveDocument.Tables(1)
- 'moisture/water
- Set r = .Cell(11, 4).Range
- With r
- .MoveEnd 1, -1
- If Len(.Text) = 0 Then
- .Text = "NO"
- GoSub Fmt
- Else
- If .Text < 5 Or .Text > 7 Then GoSub Fmt
- End If
- End With
- 'ash/grey
- Set r = .Cell(12, 4).Range
- With r
- .MoveEnd 1, -1
- If Len(.Text) = 0 Then
- .Text = "NO"
- GoSub Fmt
- Else
- If .Text > 5 Then GoSub Fmt
- End If
- End With
- 'water-insoluble matter
- Set r = .Cell(13, 4).Range
- With r
- .MoveEnd 1, -1
- If Len(.Text) = 0 Then
- .Text = "NO"
- GoSub Fmt
- Else
- If .Text > 1 Then GoSub Fmt
- End If
- End With
- 'lead
- Set r = .Cell(16, 4).Range
- With r
- .MoveEnd 1, -1
- If Len(.Text) = 0 Then
- .Text = "NO"
- GoSub Fmt
- Else
- If .Text > 3 Then GoSub Fmt
- End If
- End With
- 'arsenic
- Set r = .Cell(17, 4).Range
- With r
- .MoveEnd 1, -1
- If Len(.Text) = 0 Then
- .Text = "NO"
- GoSub Fmt
- Else
- If .Text > 3 Then GoSub Fmt
- End If
- End With
- 'total plate count
- Set r = .Cell(19, 4).Range
- With r
- .MoveEnd 1, -1
- If Len(.Text) = 0 Then
- .Text = "NO"
- GoSub Fmt
- Else
- If .Text > 5000 Then GoSub Fmt
- End If
- End With
- 'mold
- Set r = .Cell(20, 4).Range
- With r
- .MoveEnd 1, -1
- If Len(.Text) = 0 Then
- .Text = "NO"
- GoSub Fmt
- Else
- If .Text > 100 Then GoSub Fmt
- End If
- End With
- End With
- Exit Sub
- Fmt:
- With r.Font
- .NameAscii = "Impact"
- .Size = 16
- .ColorIndex = wdRed
- .Underline = wdUnderlineSingle
- End With
- Return
- End Sub
复制代码 |
|