Dear Norie,
Is it going to be like this?
Option Explicit
Private Sub CommandButton1_Click()
Dim MSG1 As String
Dim nr As Long
Dim ssheet As Worksheet
If Me.TextStockNo = "" Then
MsgBox "Form incomplete"
Exit Sub
End If
' Application.Calculation = False
Set ssheet = ThisWorkbook.Sheets("Data Base")
MSG1 = MsgBox("Do you want to submit the form?", vbYesNo)
If MSG1 = vbYes Then
With Worksheets("Ranges")
Me.ComboRepName.RowSource = ""
Me.ComboRepName.List = .Range("A2", .Range("A" & Rows.Count).End(xlUp)).Value
Me.ComboVehicleMake.RowSource = ""
Me.ComboVehicleMake.List = .Range("C2", .Range("C" & Rows.Count).End(xlUp)).Value
Me.ComboColour.RowSource = ""
Me.ComboColour.List = .Range("E2", .Range("E" & Rows.Count).End(xlUp)).Value
Me.ComboDealer.RowSource = ""
Me.ComboDealer.List = .Range("G2", .Range("G" & Rows.Count).End(xlUp)).Value
Me.ComboAdvert.RowSource = ""
Me.ComboAdvert.List = .Range("I2", .Range("I" & Rows.Count).End(xlUp)).Value
End With
With ssheet
nr = .Cells(.Rows.Count, 2).End(xlUp).Row + 1
.Cells(nr, 2) = Me.TextStockNo
.Cells(nr, 3) = Me.ComboRepName
.Cells(nr, 5) = Me.DTPickerDate
.Cells(nr, 6) = Me.TextYearModel
.Cells(nr, 7) = Me.ComboVehicleMake
.Cells(nr, 8) = Me.TextDescription
.Cells(nr, 9) = Me.TextRegNo
.Cells(nr, 9) = Me.TextMileage
.Cells(nr, 11) = Me.ComboColour
.Cells(nr, 12) = Me.TextBought
.Cells(nr, 13) = Me.TextSold
.Cells(nr, 15) = Me.ComboDealer
.Cells(nr, 16) = Me.ComboAdvert
.Cells(nr, 17) = Me.TextAddComments
.Cells(nr, 18) = Me.DTPickerInvoiceDate
.Cells(nr, 19) = Me.TextInvoiceNo
End With
End If
Call UserForm_Initialize
' Application.Calculation = True
End Sub
Bookmarks