When the userform is completed there would be information added to in column (C) and (D) with that i would like an addition information with that, to have word located in Row 2 Cell (C), to column (E)
Please ask question if i need to explain more in detail
FIY: code pasted here might have other function i would like that this code to coexist with the current code.Thanks Again Chandoo Ninjas.
Userform Code underneath this line
------------------------------------------------------------------------------------------
Private Sub Cmdbutton_close_Click()
Unload Me
End Sub
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
ws.Cells(iRow, 4).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
Please ask question if i need to explain more in detail
FIY: code pasted here might have other function i would like that this code to coexist with the current code.Thanks Again Chandoo Ninjas.
Userform Code underneath this line
------------------------------------------------------------------------------------------
Private Sub Cmdbutton_close_Click()
Unload Me
End Sub
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
ws.Cells(iRow, 4).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