Hello,
Im trying to make a daily brief log to update the date after each printed page
Ie If date is in cell A1 is Friday,June 13, 2014 and I ask for 3 copies to be printed then
page 1 should read Friday June 13 2014 when printed
Page 2 should read Saturday June 14 2014 when printed
Page 3 should read Sunday June 15 2014 when printed and etc automatically adding the days
I found the below code but it wouldn't work for me
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, _
ByVal Target As Range, Cancel As Boolean)
Dim sDate, i
retryDate:
sDate = InputBox("Enter the starting date, or click 'OK'" & _
" for the current date", "Start Date")
If sDate = "" Then
sDate = Date
ElseIf Not IsDate(sDate) Then
retryDate = MsgBox("Invalid date format", vbRetryCancel + vbCritical, "Retry?")
Select Case retry
Case Is = vbRetry
GoTo retryDate
Case Is = vbCancel
Target.Offset(0, 1).Select
Exit Sub
End Select
End If
retryNum:
numCopies = InputBox("Enter the number of signup " & _
"sheets to print.", "Days to Print")
If numCopies = "" Then
Target.Offset(0, 1).Select
Exit Sub
ElseIf Not IsNumeric(numCopies) Then
retryNum = MsgBox("Invalid numeric format", vbRetryCancel + vbCritical, "Retry?")
Select Case retryNum
Case Is = vbRetry
GoTo retryNum
Case Is = vbCancel
Target.Offset(0, 1).Select
Exit Sub
End Select
End If
For i = 0 To numCopies - 1
ActiveSheet.Range("A1").Value = CDate(sDate) + i
ActiveSheet.PrintOut copies:=1
Next i
Target.Offset(0, 1).Select
End Sub
I uploaded a sample copy of the briefing log.
Thanks for any help in advance.
BRIEF LOG example.xls
Bookmarks