Hello guys, i have created this userform and got it to work up to the point of the information text in the textbox send to a new row.
What i want in addition is that when i click on a row and then click on the button called add_subtask
***Have that row of column (D and E) shown on the userform.
***When clicked on the userform option button (ADD SUBTASK) have all the information on the userform sent to a new row. Demonstration is on attachment and code is underneath this line, i would appreciate it a mil Chandoo Ninjas and thanks for your time.
What i want in addition is that when i click on a row and then click on the button called add_subtask
***Have that row of column (D and E) shown on the userform.
***When clicked on the userform option button (ADD SUBTASK) have all the information on the userform sent to a new row. Demonstration is on attachment and code is underneath this line, i would appreciate it a mil Chandoo Ninjas and thanks for your time.
Code:
Private Sub CommandButton1_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GENERAL")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
'check for a Name number
If Trim(Me.textbox_name.Value) = "" Then
Me.textbox_name.SetFocus
MsgBox "Please complete the form"
Exit Sub
End If
'copy the data to the database
ws.Cells(iRow, 3).Value = Me.textbox_name.Value
MsgBox "Data added", vbOKOnly + vbInformation, "Data Added"
'clear the data
Me.textbox_name.Value = ""
Me.textbox_name.SetFocus
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub