I write this code for user form to enter data in the same row but different times and it gives (Invalid qualifier), date was specified in the rows
Private Sub CmdAdd_Click()
Dim RN As Long
Dim CN As Long
Dim NDate As Long
NDate = TxtDate.Value
RN = Application.WorksheetFunction.Match(NDate, Sheets("Data").Range("A7:A400"), 0)
CN = 1
Select Case CboMeal.Value
Case Breakfast
CN.Value = CN + 1
Case Lunch
CN.Value = CN + 6
Case Dinner
CN.Value = CN + 11
End Select
Sheet1.Cells(RN, CN).Value = TxtH1.Value
Sheet1.Cells(RN, CN + 1).Value = TxtC1.Value
Sheet1.Cells(RN, CN + 2).Value = TxtH2.Value
Sheet1.Cells(RN, CN + 3).Value = TxtC2.Value
End Sub