Userform: Fill multiple rows with one text box

Hello everybody,

I would like fill a table using an Userform. For each month a row should be generated. The textboxes: ID, Name and Lieferant should be filled into each row.  3 rows should be generated always (one for each month) even if there is no entry in the Textbox for that month.

Example
Unfortunately I am not able to solve this problem by myself. Perhaps one of you experts can help me.

Thank you very much
Takis1980Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Please attach your workbook.
0
rspahitzCommented:
Assuming that the first button is called Button1, you should have it linked to a VB procedure called Button1_Click so that you can add the text when the button is clicked.

To populate the rows, you'd have something like this (depending on the names of your text boxes:

Sub Button1_Click()
   row = 1' may need to auto-calculate to find the next available row
   Cells(row, 1).Value = txtID.Text
   Cells(row, 2).Value = txtName.Text
   Cells(row, 3).Value = txtLieferant.Text
   Cells(row, 4).Value = txtJan.Text  

   row = row + 1
   Cells(row, 1).Value = txtID.Text
   Cells(row, 2).Value = txtName.Text
   Cells(row, 3).Value = txtLieferant.Text
   Cells(row, 5).Value = txtFeb.Text

   row = row + 1
   Cells(row, 1).Value = txtID.Text
   Cells(row, 2).Value = txtName.Text
   Cells(row, 3).Value = txtLieferant.Text
   Cells(row, 6).Value = txtMar.Text
End Sub

If you have more months, there are other ways to make the above more efficient.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Roy CoxGroup Finance ManagerCommented:
As Martin says attach an example workbook
0
Takis1980Author Commented:
Thanks rspahitz, this was exactly the part that I was missing
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.