Hi, Templemind,
Res ia a Variable while number 5 is a constant, itīs simple as that. I would suggest not to work with a Textbox to let the user type items (I prefer a Listbox or Combobox where the items are listed or may be added if needed).
Private Sub SubmitButton_Click()
Dim emptyRow As Long
Dim Res As Variant
With Sheet2
Res = Application.Match(Roomnum.Value, .Rows(4), 0)
If Not IsError(Res) Then
emptyRow = .Cells(Rows.Count, Res).End(xlUp).Offset(1, 0).Row
.Cells(emptyRow, Res).Value = Credittxt.Value
End If
End With
End Sub
I donīt see your workbook so it may be a typo or the searched value may just be part of the string in the cell or there may be formulas...
Ciao,
Holger
Bookmarks