
New Member

March 18, 2019

vba find date and enter UserForm text box
hello, i have a list where vba need to find the date in sheets and also the machine name then paste the userform text box
userform works but it do not paste any info.
i have played around with this a few days and can not figure how to make it work, i really hope someone here can help with this
thank you
Edit:
big thanks to Christofer Weber that made this work
at https://superuser.com/question.....00#1414900
and big thanks to 大灰狼1976 that made all the work
at http://www.vbaexpress.com/foru.....-next-cell
if someone need to download the complete file, the working file is located on the vbaexpress forum
thank you all


November 8, 2013

Hi Martin,
If you want to paste data rom textboxes into the correct sheet cells, the code from your CommandButton1 should look like this:
With Sheets(Mon)
Set rng = .Rows(3).Find(Dat, lookat:=xlWhole)
If Not rng Is Nothing Then
Set mch = .Columns(1).Find(mch1, lookat:=xlWhole)
If Not mch Is Nothing Then
.Cells(mch.Row, rng.Column + 1) = TextBox1
.Cells(mch.Row, rng.Column + 2) = Format(TextBox2, "d/m/yy")
.Cells(mch.Row, rng.Column + 3) = TextBox3
Else
MsgBox "can not find machine"
End If
Else
MsgBox "can not find date"
End If
End With
1 Guest(s)
