PANKAJUTEKAR
Board Regular
- Joined
- Jun 10, 2011
- Messages
- 79
Dear Sir,
In following coding, when i am click on comd bttn the data is saved in (e4:j4).
now the problem is,
1). when i am try to add a new data on the next row, it is not coming.
2). as the comd bttn is used, the comd btn add the record in all rows whatever mentioned.
So i require help from VBA Gurus to solve the problem.
Private Sub CommandButton4_Click()
Call addrecord
ThisWorkbook.Activate
End Sub
Sub addrecord()
Dim i As Integer, j As Integer, k As Integer
Do Until j = 10
i = 4
j = 5
Cells(i, j) = Cells(5, 3)
j = j + 1
Cells(i, j) = Cells(10, 3)
j = j + 1
Cells(i, j) = Cells(18, 3)
j = j + 1
Cells(i, j) = Cells(19, 3)
j = j + 1
Cells(i, j) = Cells(21, 3)
j = j + 1
Cells(i, j) = Cells(22, 3)
Loop
Range("c5,c10,c18,c19,c21,c22").Select
Selection.ClearContents
End Sub
In following coding, when i am click on comd bttn the data is saved in (e4:j4).
now the problem is,
1). when i am try to add a new data on the next row, it is not coming.
2). as the comd bttn is used, the comd btn add the record in all rows whatever mentioned.
So i require help from VBA Gurus to solve the problem.
Private Sub CommandButton4_Click()
Call addrecord
ThisWorkbook.Activate
End Sub
Sub addrecord()
Dim i As Integer, j As Integer, k As Integer
Do Until j = 10
i = 4
j = 5
Cells(i, j) = Cells(5, 3)
j = j + 1
Cells(i, j) = Cells(10, 3)
j = j + 1
Cells(i, j) = Cells(18, 3)
j = j + 1
Cells(i, j) = Cells(19, 3)
j = j + 1
Cells(i, j) = Cells(21, 3)
j = j + 1
Cells(i, j) = Cells(22, 3)
Loop
Range("c5,c10,c18,c19,c21,c22").Select
Selection.ClearContents
End Sub