Link to home
Start Free TrialLog in
Avatar of Omar Hernandez
Omar Hernandez

asked on

Using userform, when click - Make information insert in two Rows instead of one

Hy guys, i am trying to find a way to make this userform, once i click on it to write giving information in two rows. not having any luck coding it. First time using Experts Exchange, Thanks for your time and your help.

Row One Having
ws.Cells(iRow, 3).Value = Me.textbox_name.Value
ws.Cells(iRow, 4).Value = Me.textbox_name.Value
ws.Cells(iRow, 5).Value = Range("C2").Value

and

Row Two having
ws.Cells(iRow, 4).Value = Me.textbox_name.Value
ws.Cells(iRow, 5).Value = Range("C2").Value


Original code is underneath this line, if you will need any additional information please feel free to ask. Thanks again
------------------------------------------------------------------------------------------


'find first empty row in database
iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

'check for a Name number
If Trim(Me.textbox_name.Value) = "" Then
Me.textbox_name.SetFocus
MsgBox "Please complete the form"
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 3).Value = Me.textbox_name.Value
ws.Cells(iRow, 4).Value = Me.textbox_name.Value
ws.Cells(iRow, 5).Value = Range("C2").Value
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Removed Visual Basic Classic topic.
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Omar Hernandez
Omar Hernandez

ASKER

Thanks Subodh, this did the trick.
You're welcome Omar! Glad it worked for you.