Looking for help to find a solution for my submitted project.

zahid

New member
Joined
Jul 6, 2018
Messages
8
Reaction score
0
Points
0
Excel Version(s)
2016
Hello everyone, Hope everyone's fine. Im looking for help to solve my VBA project. I have tried different things to solve my problem but did not work the way I want it to. I have submitted my project with this thread....
As a newbie I could not make a way to solve my projects problems. Please help me to make it done with this project. Thanks in advance. If you have any question please ask me.
 

Attachments

  • Data creation of PN1.xlsm
    44.9 KB · Views: 16
Last edited:
You need to explain more.

For one question, free help is easy to get. For a project, help is not so easy. To solve a project problem, break it down to one question per thread. You can always reference another thread if needed. Think in concepts. e.g. How do I fill ListBox1 in Userform1 with values dynamically from A2 and down?
 
Well, thanks for your query and advice Sir. Actually my problem with this project is, If you notice that there are some boxes which are with same data input labelled from the second row to sixth row in the userform. I can transfer only 1st & 2nd row input into my excel sheet. If I put data in the first, second and 3rd row it does not go into my worksheet, in this case only first & second rows of data get into the worksheet. I want it like that when I put data in the userform , data will go in the sheet according to my input. If I put one row, data must get in to the sheet for that single row. If I put more data than it also go for more into my worksheet dynamically down as you mentioned in your query. But at the same time the first row of the userform will be going down dynamically down as well. So I want it like that 1st row of the userform will be going down dynamically with second to sixth rows into my worksheet according to my input in the userform. Hope I could explain it to you sir.
Regards.
 
I would suggest coding with 2 loops, one for rows and one for columns in your Userform, sort of. Name your controls accordingly. Maybe something like C21. Where 1 is your 1st row and 2 is your 2nd column in your Userform. This makes concatenating in your loop easy.

Add the Column letter to the control's Tag property.

These methods makes it easier to code and easier to maintain your code.

Here is how to get the Value of a control using the concatenation concept:
Code:
MsgBox Controls("TextBox" & 7)
'or if renamed as suggested
'MsgBox Controls("C" & c & r) 'c and r would be loop variables

Normally, the initial row number is the End, xlUp method that you used but for Column A. If you do it for each column and if they leave a value empty, your record/row alignment will be off.
 
Thanks for your suggestion.
regards.
 
Back
Top