Solved

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

Posted on 2016-08-26
4
40 Views
Last Modified: 2016-08-26
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
0
Comment
Question by:Omar Hernandez
  • 2
4 Comments
 
LVL 45

Expert Comment

by:Martin Liss
ID: 41772594
Removed Visual Basic Classic topic.
0
 
LVL 28

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41772634
A sample workbook would be helpful.

BTW find the first empty row in the col. D like this.....
iRow = ws.Cells(Rows.Count, 4).End(xlUp).Offset(1, 0).Row

Open in new window


Then you may add the information in the second row like this...
ws.Cells(iRow+1, 4).Value = Me.textbox_name.Value
ws.Cells(iRow+1, 5).Value = Range("C2").Value

Open in new window

If that doesn't help, consider uploading a sample workbook.
0
 

Author Closing Comment

by:Omar Hernandez
ID: 41772657
Thanks Subodh, this did the trick.
0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41772658
You're welcome Omar! Glad it worked for you.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
integer8 values 1 10
Formula to convert ranked data 2 11
TT Master To Fresh - Rework 4 25
Quickbooks - Merging data 3 8
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now