Private Sub CmdOk_Click()
Dim OrderDate As Date 'Order Date
Dim ShortDate As Date 'Short Date of Order Date
Dim CustName As String 'Customer Name
Dim email As String 'Email
'Dim rCl As Range
OrderDate = TxtOrderDate.Text
ShortDate = TxtshortDate.Text
TxtOrderDate = Format(OrderDate, "dd-mmm-yy")
TxtshortDate = Format(ShortDate, "mmm-yy")
'CustName = TxtCustName
'email = TxtEmail
'TO DO
'Need to Format the £ and Date of AccFee etc
'Need to arrange If's into 1 massive group of If's
'If ChkAccFee.Value = True And TxtAccInv.Value = False Then
'MsgBox "You must enter an Acceptance Fee Invoice Number", vbOKOnly
'GoTo Finish
'Else
'GoTo Continue
'End If
'If Inipay.Value = True And TxtIPInv.Value = False Then
'MsgBox "You must enter an Initial Payment Invoice Number", vbOKOnly
'GoTo Finish
'Else
'GoTo Continue
'End If
'If ChkCom.Value = ture And TxtComAmt = False Then
'MsgBox "You must enter a Commission Value", vbOKOnly
'GoTo Finish
'Else
'GoTo Continue
'End If
'If TMCYes = False And TMCNo = False Then
'MsgBox "You must select a TMC Type", vbOKOnly
'GoTo Finish
'Else
'GoTo Continue
'End If
'If OptNew.Value = False And OptPart.Value - False Then
'MsgBox "You select if the car is New or Part Ex", vbOKOnly
'GoTo Finish
'Else
'GoTo Continue
'End If
Continue:
Sheets("Sheet1").Select
Range("A21").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
'With Sheets("Sheet1")
'Set rCl = .Cells(.Rows.Count, 1).End(xlUp).Offset(1)
'End With
ActiveCell.Value = TxtOrderDate.Text
ActiveCell.Offset(0, 1) = TxtshortDate 'force short date
'force URN - ?
ActiveCell.Offset(0, 2) = TxtCustName
ActiveCell.Offset(0, 3) = TxtEmail
ActiveCell.Offset(0, 4) = TxtContNo
If TMCYes.Value = True Then
ActiveCell.Offset(0, 5) = "Yes"
Else
ActiveCell.Offset(0, 5) = "No"
End If
ActiveCell.Offset(0, 6).Value = CombStkType.Value
If ChkDeposit.Value = True Then
ActiveCell.Offset(0, 7) = TxtDepAmt
ActiveCell.Offset(0, 8) = TxtDepDate
ActiveCell.Offset(0, 9) = TxtDepInv
Else
ActiveCell.Offset(0, 7) = 0
ActiveCell.Offset(0, 8) = ""
ActiveCell.Offset(0, 9) = ""
End If
If ChkAccFee.Value = True Then
ActiveCell.Offset(0, 10) = TxtAccAmt
ActiveCell.Offset(0, 11) = TxtAccDate
ActiveCell.Offset(0, 12) = TxtAccInv
Else
ActiveCell.Offset(0, 10) = 0
ActiveCell.Offset(0, 11) = ""
ActiveCell.Offset(0, 12) = ""
End If
If ChkIniPay.Value = True Then
ActiveCell.Offset(0, 13) = TxtIPAmt
ActiveCell.Offset(0, 14) = TxtIPDate
ActiveCell.Offset(0, 15) = TxtIPInv
Else
ActiveCell.Offset(0, 13) = 0
ActiveCell.Offset(0, 14) = ""
ActiveCell.Offset(0, 15) = ""
End If
If OptBacs.Value = True Then
ActiveCell.Offset(0, 16) = "Bacs"
ElseIf OptChq.Value = True Then
ActiveCell.Offset(0, 16) = "Cheque"
Else
ActiveCell.Offset(0, 16) = "Credit Card"
ActiveCell.Offset(0, 17) = TxtCC
End If
ActiveCell.Offset(0, 18).Value = CombContract.Value
ActiveCell.Offset(0, 19).Value = CombContType.Value
ActiveCell.Offset(0, 20).Value = TxtVehicle
ActiveCell.Offset(0, 21).Value = TxtDealer
If ChkCom.Value = True Then
ActiveCell.Offset(0, 22).Value = TxtComAmt
ActiveCell.Offset(0, 23).Value = TxtComDate
Else
ActiveCell.Offset(0, 22).Value = 0
ActiveCell.Offset(0, 23).Value = ""
End If
If OptNew.Value = True Then
ActiveCell.Offset(0, 24) = "New"
Else
ActiveCell.Offset(0, 24) = "Part Exchange"
End If
ActiveCell.Offset(0, 25).Value = TxtReg
'Force Status defaulting to first Option (Live)
ActiveCell.Offset(0, 26).Select
With Selection.Validation
.Add xlValidateList, xlValidAlertStop, xlBetween, "=Status"
.InCellDropdown = True
ActiveCell = Range("Status")(1)
End With
end sub