Hi
I want when add ID in textbox1 and price in textbox2 then should add new row with the same formatting and put the price under date(today)
here is data
form
result(see in row18)
but if the ID is existed like this
then result(see row12) without add new row just add price under date because the id is existed)
last thing when add new row should add zero as hyphen empty cells
here is simple code and I would fix it , adapting
thanks
I want when add ID in textbox1 and price in textbox2 then should add new row with the same formatting and put the price under date(today)
here is data
form
result(see in row18)
but if the ID is existed like this
then result(see row12) without add new row just add price under date because the id is existed)
last thing when add new row should add zero as hyphen empty cells
here is simple code and I would fix it , adapting
VBA Code:
Private Sub CommandButton1_Click()
Dim findDate As Date
Dim findStr As String
Dim ws As Worksheet, R As Range ,lr As Long
Set ws = Sheets("PRICES")
findStr = Format(findDate, "YYYY/MM/DD")
Set R = ws.Rows(1).Find(what:=findStr, LookIn:=xlValues, lookat:=xlWhole)
LR = ws.Cells(Rows.Count, 2).End(3).Row
Range("C" & LR + 1) = TextBox1.Value
R.Offst(,1).Value=Textbox2.Text
End Sub