Advertisement
Advertisement
| 06.29.2008 at 09:18AM PDT, ID: 23525060 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: |
'****************************************************************
' [[ENTER BUTTON]]
'****************************************************************
Private Sub CmdEnter_Click()
Application.Calculation = xlCalculationManual
Do stuff&..
If chkClean = False Then
Call PrintModule
End If
Application.Calculation = xlCalculationAutomatic
Call UserForm_Initialize
Application.ScreenUpdating = True
End If
----------------------------------------------------------------
Sub PrintModule()
Dim shErrors As Worksheet
Dim shPrint As Worksheet
Dim r As Integer
Dim s As Integer
Dim UnitNumber As Long
Application.ScreenUpdating = False
Set shErrors = ActiveWorkbook.Sheets("ERRORS")
Set shPrint = ActiveWorkbook.Sheets("Print")
Sheets("Print").Select
shPrint.Cells(4, 3).Value = ""
shPrint.Cells(6, 1).Value = ""
shPrint.Cells(6, 4).Value = ""
shPrint.Cells(11, 3).Value = ""
'PrintErrors.Value = ""
'Find last unit number in Errors sheet
r = 5
Do
UnitNumber = shErrors.Cells(r, 3).Value
r = r + 1
Loop Until shErrors.Cells(r, 3) = ""
shPrint.Cells(4, 3).Value = UnitNumber
'Find and copy details
s = 11
r = 5
Do
If shErrors.Cells(r, 3).Value = UnitNumber Then
shPrint.Cells(6, 1).Value = shErrors.Cells(r, 4).Value 'Date
shPrint.Cells(6, 4).Value = shErrors.Cells(r, 20).Value 'Inspector
shPrint.Cells(s, 3).Value = shErrors.Cells(r, 6).Value 'Error description
s = s + 1
End If
r = r + 1
Loop Until shErrors.Cells(r, 3) = ""
Sheets("Print").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.ScreenUpdating = True
Sheets("ERRORS").Select
End Sub
|