I'm new to VBA and recently just started learning on build a data entry form with VBA code. The problem I'm facing now is that my second data input won't goes to the next row, it keep overwriting my previous data input. I have checked other threads with similar questions but I just can't seem to get it to work. Any help would be appreciated! Thank you guys.
PS: every data is designed to goes from row 9 (ex. A9, B9 ...) since I have a picture on the top.
- Dim sh As Worksheet
- Set sh = ThisWorkbook.Sheets("2B Return Template")
- Dim Last_Row As Long
- Last_Row = Cells(Rows.Count, "A9").End(xlUp).Row + 1
- sh.Range("A9").Value = Me.TextBox1.Value
- sh.Range("B9").Value = Me.TextBox2.Value
- sh.Range("C9").Value = Me.TextBox3.Value
- If Me.OptionButton1.Value = True Then sh.Range("D9").Value = "Jepp"
- If Me.OptionButton2.Value = True Then sh.Range("D9").Value = "Amazon"
- sh.Range("E9").Value = Me.product.Value
- sh.Range("F9").Value = Me.Rechargeable.Value
- sh.Range("G9").Value = Me.Sensor.Value
- sh.Range("H9").Value = Me.customersreason.Value
- sh.Range("I9").Value = Me.defective_reason.Value
- sh.Range("J9").Value = Me.detail_1.Value
- sh.Range("K9").Value = Me.Detail_2.Value
- sh.Range("L9").Value = Me.Jepp_defect_Analysis.Value
- sh.Range("M9").Value = Me.Action.Value
- sh.Range("N9").Value = Me.Factory_result.Value