jadhavabhay
New Member
- Joined
- Dec 28, 2015
- Messages
- 2
I am facing problem with folowing code cant add data to new row
Private Sub Submit_Click()
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("S")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
ssheet.Cells(nr, 5) = Me.Tb1
ssheet.Cells(nr, 6) = Me.Tb2
ssheet.Cells(nr, 7) = Me.Tb3
ssheet.Cells(nr, 8) = Me.Tb4
ssheet.Cells(nr, 12) = Me.Cb1
ssheet.Cells(nr, 13) = Me.Tb5
ssheet.Cells(nr, 17) = Me.Tb6
ssheet.Cells(nr, 18) = Me.Tb7
ssheet.Cells(nr, 19) = Me.Tb8
ssheet.Cells(nr, 20) = Me.Cb2
ssheet.Cells(nr, 21) = Me.Tb10
ssheet.Cells(nr, 22) = Me.Tb11
ssheet.Cells(nr, 23) = Me.Tb12
ssheet.Cells(nr, 24) = Me.Tb13
ssheet.Cells(nr, 25) = Me.Tb14
ssheet.Cells(nr, 31) = Me.Tb15
ssheet.Cells(nr, 42) = Me.Tb16
ssheet.Cells(nr, 47) = Me.Tb17
End Sub
Private Sub Submit_Click()
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("S")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
ssheet.Cells(nr, 5) = Me.Tb1
ssheet.Cells(nr, 6) = Me.Tb2
ssheet.Cells(nr, 7) = Me.Tb3
ssheet.Cells(nr, 8) = Me.Tb4
ssheet.Cells(nr, 12) = Me.Cb1
ssheet.Cells(nr, 13) = Me.Tb5
ssheet.Cells(nr, 17) = Me.Tb6
ssheet.Cells(nr, 18) = Me.Tb7
ssheet.Cells(nr, 19) = Me.Tb8
ssheet.Cells(nr, 20) = Me.Cb2
ssheet.Cells(nr, 21) = Me.Tb10
ssheet.Cells(nr, 22) = Me.Tb11
ssheet.Cells(nr, 23) = Me.Tb12
ssheet.Cells(nr, 24) = Me.Tb13
ssheet.Cells(nr, 25) = Me.Tb14
ssheet.Cells(nr, 31) = Me.Tb15
ssheet.Cells(nr, 42) = Me.Tb16
ssheet.Cells(nr, 47) = Me.Tb17
End Sub