Hello,
I am busy with make a code that we can use de UserForm, fill in the Form and the button OK will copy the information into the first empty row and in differen colums.
This is the code I Use:
The only thing that willl be writing in the worksheet is the first row --> Name.
How can I be sure that all the 7 colums will be filled in one row?
I am busy with make a code that we can use de UserForm, fill in the Form and the button OK will copy the information into the first empty row and in differen colums.
This is the code I Use:
Code:
Private Sub OK_Click()
Dim emptyRow As Long
'Make Sheet1 active
Blad5.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 1).Value = NameTextBox.Value
Cells(emptyRow, 2).Value = PhoneTextBox.Value
Cells(emptyRow, 3).Value = CityListbox.Value
Cells(emptyRow, 4).Value = DinnerComboBox.Value
If DateCheckBox1.Value = True Then Cells(emptyRow, 5).Value = DateCheckBox1.Caption
If DateCheckBox2.Value = True Then Cells(emptyRow, 5).Value = Cells(emptyRow, 5).Value & " " & DateCheckBox2.Caption
If DateCheckBox3.Value = True Then Cells(emptyRow, 5).Value = Cells(emptyRow, 5).Value & " " & DateCheckBox3.Caption
If CarOptionButton1.Value = True Then
Cells(emptyRow, 6).Value = "Yes"
Else
Cells(emptyRow, 6).Value = "No"
End If
Cells(emptyRow, 7).Value = MoneyTextBox.Value
End Sub
The only thing that willl be writing in the worksheet is the first row --> Name.
How can I be sure that all the 7 colums will be filled in one row?
Last edited by a moderator: