~~ Correction, Fiscal year is not needed. Calender year please.
I am working on a work project so that when a user clicks a command button, it clears all daily data out of a log to create a new log for the next cylce. Everything works in my code, but I was wondering if there was a way to pre-populate the inputbox so the user doesn't have to type as much into the box, just verify that it is correct and add the next number. Our daily numbers go YY MM DD ABC ###. The ### only changes when we have multiple missions per day, so this would be user inputted. The "ABC" is always "ABC", YY MM DD is the two digit year, month, day.
Thank you!!
Private Sub CommandButton1_Click()
Response = MsgBox("Are you sure you want to clear all data?", vbYesNo)
If Response = vbNo Then
Exit Sub
End If
ThisWorkbook.Worksheets("Datasheet").Range("B1:D1, G1:J1, O1:Q1, T1, W1, A5:D31, G5:Q31, S5:V31, Y5:AC31").ClearContents
Range("G5:I5, Y5:AA5").Value = "1"
Range("G1").Select
Response = MsgBox("Do you wish to save as a new file?", vbYesNo)
If ((Response = "False") Or (Response = vbNullString)) Then Exit Sub
If Response = vbNo Then
Exit Sub
End If
newmissionnumber = UCase(Application.InputBox("Enter the FULL new Mission Number."))
If ((newmissionnumber = "False") Or (newmissionnumber = vbNullString)) Then Exit Sub
If newmissionnumber = False Then Exit Sub
ThisWorkbook.Worksheets("Datasheet").Range("B1:D1").Value = newmissionnumber
If Response <> False Then
ThisFile = "ABCDEFGH " & newmissionnumber & ".xlsm"
Application.Dialogs(xlDialogSaveAs).Show (ThisFile)
End If
End Sub
Bookmarks