Hi Tony
Thanks for replying, as you can tell i am not overly knowledgeable on VBA and seem to somehow muddle my way through. However I am not sure how to apply the code you gave me to my userform? This is what i have done.
Function FindEmptyCellInColumn(pColumn As Long) As Long
' Find the first empty cell in the requested column
FindEmptyCellInColumn = Sheet2.Cells(Sheet2.Rows.Count, pColumn).End(xlUp).Row
End Function
Private Sub BtnBookAppt_Click()
Dim a As Long
a = FindEmptyCellInColumn(2)
erow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
Sheet2.Cells(erow, 2).Value = Me.tbxName.Value
Sheet2.Cells(erow, 2).Value = UserForm2.Tbxstreet.Value
Sheet2.Cells(erow, 3).Value = UserForm2.tbxTown.Value
Sheet2.Cells(erow, 4).Value = UserForm2.TbxCounty.Value
Sheet2.Cells(erow, 6).Value = UserForm2.tbxPostCode.Value
Sheet2.Cells(erow, 7).Value = UserForm2.tbxEmail.Value
Sheet2.Cells(erow, 8).Value = UserForm2.tbxContact1.Value
Sheet2.Cells(erow, 9).Value = UserForm2.tbxContact2.Value
Sheet2.Cells(erow, 11).Value = UserForm2.CboPriority.Value
Sheet2.Cells(erow, 12).Value = UserForm2.tbxApptDate.Value
Sheet2.Cells(erow, 13).Value = UserForm2.cboSessions.Value
Sheet2.Cells(erow, 14).Value = UserForm2.CboTime.Value
Sheet2.Cells(erow, 14).Value = UserForm2.cbovenue.Value
Sheet2.Cells(erow, 14).Value = UserForm2.tbxComments.Value
Unload UserForm2
UserForm2.Show
End Sub
Can yuo help me understand how i intergrate it please, thanks for helping.
Michelle
Bookmarks