Private Sub workbook_open()
verifmold
verifmachine
End Sub
Public Sub verifmold()
Dim pl As Range, pl2 As Range
Dim endline As Integer, endline2 As Integer
Dim cell As Range, celval As Range
With Worksheets("Moldref")
Range("D65536").Select
ActiveCell.End(xlUp).Select
endline = ActiveCell.Row
cell1 = Cells(6, 4).Address
cell2 = Cells(endline, 4).Address
Set pl = Range(cell1, cell2)
For Each cell In pl
If cell.Font.ColorIndex = 3 And Not cell.Value = "" Then
Prendstoicamold.labelmold.Caption = "The mold under ref. " & cell.Value & " must be change"
Prendstoicamold.labermold2.Caption = "Less than " & cell.Offset(0, 8).Value & "pcs may currently be maide"
areyousure2.Label1.Caption = "Are you sure the mold, under the ref " & cell.Value & " have been removed ?"
Prendstoicamold.Show
End If
Next cell
End With
End Sub
Public Sub verifmachine()
Dim pl As Range, pl2 As Range
Dim endline As Integer, endline2 As Integer
Dim cell As Range, celval As Range
With Worksheets("Machineref")
Range("D65536").Select
ActiveCell.End(xlUp).Select
endline2 = ActiveCell.Row
cell3 = Cells(endline2, 4).Address
cell1 = Cells(6, 4).Address
Set pl2 = Range(cell1, cell3)
For Each celval In pl2
If celval.Font.ColorIndex = 3 And Not celval.Value = "" Then
Prendstoicamachine.labelmachine.Caption = "The " & celval.Value & "'s machine must be check!"
Prendstoicamachine.labelmachine2.Caption = "Less than " & celval.Offset(1, 1).Value & " pcs may curently be maide"
areyousure2.Label1.Caption = "Are you sure the machine's screw, under the ref " & celval.Value & " have been changed ?"
Prendstoicamachine.Show
End If
Next celval
End With
End Sub