I have a UserForm that enables users to enter data into a worksheet.
A serial number is created for each row of data based on 2 ComboBox selection and 0001
at the end.
For example, MAPR0001
where MA
comes from a ComboBox and PR
from another one and at the end 0001
is added and is incremented for another selection of MA
and PR
. (MAPR0002
)
Then I have a second UserForm that should allow me to update my database.
Upon selection of a serial number from a ComboBox the second UserForm pulls back the data from the worksheet to some TextBoxes.
Till here everything works fine.
But I fail to add data to a specific serial number.
My code for the command button:
Private sub Commandbuttonclick ()
If Me.ComboBox1.Value = "" Then
MsgBox "Request No. Can Not be Blank", vbExclamation, "Request No."
Exit Sub
End If
requestno = Me.ComboBox1.Value
Sheets("DASHBOARD").Select
Dim rowselect As Double
rowselect = Me.combobox1.Value
rowselect = rowselect + 1
Rows(rowselect).Select
Cells(rowselect, 2) = Me.TextBox1.Value
Cells(rowselect, 3) = Me.TextBox2.Value
Cells(rowselect, 4) = Me.TextBox3.Value