Public Sub CommandButton1_Click()
Dim Name As String
Dim Age As Integer
Dim Row As Integer
Dim i As Integer
i = 2
Row = i
If (Sheet1.Range("D10").Value = "") Then
MsgBox ("Enter Value")
Else
Name = Sheet1.Range("D10").Value
Age = Sheet1.Range("D12").Value
Sheet2.Select
Sheet2.Range("A" & Row) = Name
Sheet2.Range("B" & Row) = Age
Sheet1.Range("D10").Value = ""
Sheet1.Range("D12").Value = ""
End If
End Sub
In the above code i want to increase Row count on every button click. Ex : In excel Row sheet1(D10) save into Sheet2(A2) While click on button next time value of D10 should be save into A3.