Hi !
I have built a user form to enter data of my field of Radish in point of Sales Record. The form is working good and entering the values correctly by these codes. But I have put some charts and additional data in my excel sheet upper rows. User form enters the value at the 2nd top row and continuously entering the values. But I want it to enter the value from row 13. Because I add data in first 12 rows. But user form keeps inserting data to his previous rows. I have tried different ways but it did not worked at all.
User form works correctly when there is nothing in sheet. But when I write data or charts in upper rows i mean at top then User form adding the value randomly. I want it to add the value in row 13. and so on. I also attached some images for better understanding.
After (I want to add values in row 13 instead of row 2)
Before (form works correctly in this sheet with out charts)
My Codes are below:
Private Sub Label1_Click()
Dim lr As Long
lr = Sheets("Radish Record").Range("A" & Rows.Count).End(xlUp).Row + 1
lr = Sheets("Radish Record").Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Radish Record").Cells(lr, 1) = Me.TextBox2.Value
Sheets("Radish Record").Cells(lr, 2) = Me.TextBox3.Value
Sheets("Radish Record").Cells(lr, 3) = Me.TextBox4.Value
Sheets("Radish Record").Cells(lr, 4) = Me.TextBox5.Value
Sheets("Radish Record").Cells(lr, 5) = Me.TextBox6.Value
Sheets("Radish Record").Cells(lr, 6) = Me.TextBox7.Value
Sheets("Radish Record").Cells(lr, 7) = Me.TextBox8.Value
Sheets("Radish Record").Cells(lr, 8) = Me.TextBox9.Value
Sheets("Radish Record").Cells(lr, 9) = Me.TextBox10.Value
Sheets("Radish Record").Cells(lr, 10) = Me.TextBox11.Value
Sheets("Radish Record").Cells(lr, 11) = Me.TextBox12.Value
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.TextBox4.Value = ""
Me.TextBox5.Value = ""
Me.TextBox6.Value = ""
Me.TextBox7.Value = ""
Me.TextBox8.Value = ""
Me.TextBox9.Value = ""
Me.TextBox10.Value = ""
Me.TextBox12.Value = ""
'Sheets("Radish Record").Range("A2") = Me.TextBox2.Value
'Sheets("Radish Record").Range("B2") = Me.TextBox3.Value
'Sheets("Radish Record").Range("C2") = Me.TextBox4.Value
'Sheets("Radish Record").Range("D2") = Me.TextBox5.Value
'Sheets("Radish Record").Range("E2") = Me.TextBox6.Value
'Sheets("Radish Record").Range("F2") = Me.TextBox7.Value
'Sheets("Radish Record").Range("G2") = Me.TextBox8.Value
'Sheets("Radish Record").Range("H2") = Me.TextBox9.Value
'Sheets("Radish Record").Range("I2") = Me.TextBox10.Value
'Sheets("Radish Record").Range("k2") = Me.TextBox12.Value
End Sub
Private Sub Label2_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Any Help Will be Highly Appreciated!! Thanks...
I have built a user form to enter data of my field of Radish in point of Sales Record. The form is working good and entering the values correctly by these codes. But I have put some charts and additional data in my excel sheet upper rows. User form enters the value at the 2nd top row and continuously entering the values. But I want it to enter the value from row 13. Because I add data in first 12 rows. But user form keeps inserting data to his previous rows. I have tried different ways but it did not worked at all.
User form works correctly when there is nothing in sheet. But when I write data or charts in upper rows i mean at top then User form adding the value randomly. I want it to add the value in row 13. and so on. I also attached some images for better understanding.
After (I want to add values in row 13 instead of row 2)
Before (form works correctly in this sheet with out charts)
My Codes are below:
Private Sub Label1_Click()
Dim lr As Long
lr = Sheets("Radish Record").Range("A" & Rows.Count).End(xlUp).Row + 1
lr = Sheets("Radish Record").Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Radish Record").Cells(lr, 1) = Me.TextBox2.Value
Sheets("Radish Record").Cells(lr, 2) = Me.TextBox3.Value
Sheets("Radish Record").Cells(lr, 3) = Me.TextBox4.Value
Sheets("Radish Record").Cells(lr, 4) = Me.TextBox5.Value
Sheets("Radish Record").Cells(lr, 5) = Me.TextBox6.Value
Sheets("Radish Record").Cells(lr, 6) = Me.TextBox7.Value
Sheets("Radish Record").Cells(lr, 7) = Me.TextBox8.Value
Sheets("Radish Record").Cells(lr, 8) = Me.TextBox9.Value
Sheets("Radish Record").Cells(lr, 9) = Me.TextBox10.Value
Sheets("Radish Record").Cells(lr, 10) = Me.TextBox11.Value
Sheets("Radish Record").Cells(lr, 11) = Me.TextBox12.Value
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.TextBox4.Value = ""
Me.TextBox5.Value = ""
Me.TextBox6.Value = ""
Me.TextBox7.Value = ""
Me.TextBox8.Value = ""
Me.TextBox9.Value = ""
Me.TextBox10.Value = ""
Me.TextBox12.Value = ""
'Sheets("Radish Record").Range("A2") = Me.TextBox2.Value
'Sheets("Radish Record").Range("B2") = Me.TextBox3.Value
'Sheets("Radish Record").Range("C2") = Me.TextBox4.Value
'Sheets("Radish Record").Range("D2") = Me.TextBox5.Value
'Sheets("Radish Record").Range("E2") = Me.TextBox6.Value
'Sheets("Radish Record").Range("F2") = Me.TextBox7.Value
'Sheets("Radish Record").Range("G2") = Me.TextBox8.Value
'Sheets("Radish Record").Range("H2") = Me.TextBox9.Value
'Sheets("Radish Record").Range("I2") = Me.TextBox10.Value
'Sheets("Radish Record").Range("k2") = Me.TextBox12.Value
End Sub
Private Sub Label2_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Any Help Will be Highly Appreciated!! Thanks...