abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,494
- Office Version
- 2019
- 2010
- Platform
- Windows
i have userform contains 3 textbox ans sheet1 contains data 3 columns and have table in sheet1
here i have code transfer data from userform to sheet1 but my problem every time when i fill data in userform and transfer data not the same format the next row what filled
here i have code transfer data from userform to sheet1 but my problem every time when i fill data in userform and transfer data not the same format the next row what filled
HTML:
Private Sub CommandButton1_Click()On Error Resume Next
Dim My_sh As Worksheet
Set My_sh = Worksheets("sheet1")
Dim lastrow As Integer
Dim i%
With My_sh
lastrow = .Cells(Rows.Count, 1).End(3).Row + 1
For i = 1 To 3
.Cells(lastrow, i).Value = Me.Controls("TextBox" & i)
Me.Controls("TextBox" & i) = ""
Next
MsgBox "done"
End With
End Sub