Tb Empposition.value

Figure 9.6

A simple form to collect information from the user.

Private Sub btn_EmpOK_Click() Dim LastRow As Long

LastRow = Worksheets("Sheet2").Range("A65536").End(xlUp).Row + 1 Cells(LastRow, 1).Value = tb_EmpName.Value Cells(LastRow, 2).Value = tb_EmpPosition.Value Cells(LastRow, 3).Value = tb_EmpHireDate.Value End Sub

Private Sub btn_EmpOK_Click() Dim LastRow As Long

LastRow = Worksheets("Sheet2").Range("A65536").End(xlUp).Row + 1 Cells(LastRow, 1).Value = tb_EmpName.Value Cells(LastRow, 2).Value = tb_EmpPosition.Value Cells(LastRow, 3).Value = tb_EmpHireDate.Value End Sub

Figure 9.7

The information gets added to the sheet.

0 0

Post a comment