Sub PrintInvoice()
Dim Response
AnotherCopy:
Sheet1.[A1:I44].PrintOut
Response = MsgBox("Do you need another copy?", _
vbYesNo + vbQuestion, "Confirmation")
If Response = vbNo Then
FillSalesList
NewInvoice
Else
GoTo AnotherCopy
End If
Sheet1.Unprotect
[G3] = [G3] + 1
Sheet1.Protect
End Sub
Private Sub FillSalesList()
With Sheets("Sales").Columns(1).Rows(65536).End(xlUp)
.Offset(1, 0) = Sheet1.[G3]
.Offset(1, 1) = Sheet1.[G7]
.Offset(1, 2) = Sheet1.[G5]
.Offset(1, 3) = Sheet1.[I42]
.Offset(1, 4) = Sheet1.[I43]
.Offset(1, 5) = Sheet1.[I44]
.Offset(1, 6) = Sheet1.[G1].Text
End With
End Sub
Sub NewInvoice()
With Sheet1
.Unprotect
Cells.Locked = False
[A11:I11, F1:F10, G3, H42:I44].Locked = True
[A12:I40, G4:G10].ClearContents
[B12].Select
.Protect
End With
End Sub
|