I assumed that you would know how to manually run the subroutine I posted.
Plan B: Temporarily modify your Exit button code this way to call the test code.
Plan B: Temporarily modify your Exit button code this way to call the test code.
Code:
'Exit Button'
Private Sub cmbExit_Click()
'Debug code
Call SaveTest
Exit Sub
'End debug code (remove code after test)
Dim Shop_Order_Number As String
Dim txt As String
Dim ows As Worksheet
Dim ocs As Range
Shop_Order_Number = Trim(txtShopOrdNum)
Set ows = Worksheets("Master")
Set ocs = ows.Cells
For i = 2 To lastrow
If ocs(i, 4).Value = Shop_Order_Number Then
ocs(i, 1).Value = txtPrefix
ocs(i, 2).Value = cboStatus
ocs(i, 3).Value = txtSuffix
ocs(i, 4).Value = txtShopOrdNum
ocs(i, 5).Value = txtEmailSubLine
ocs(i, 6).Value = txtNotes
ocs(i, 7).Value = cboStage
ocs(i, 8).Value = CheckDate(txtStartDate)
ocs(i, 9).Value = CheckDate(txtStageDue)
ocs(i, 10).Value = CheckDate(txtEndDate)
'redacted columns 11-102'
Exit For
End If
Next i
If MsgBox("Save changes?", vbYesNo, "Exit form") = vbYes Then
ThisWorkbook.Save 'NOT WORKING
MsgBox "Your work is saved", vbOKOnly, "Exit form"
End If
MsgBox txt
Unload MasterForm
End Sub