VBA Dynamic Boxes

I need to dynamically add text boxes to a vba form and when they user hits save it then saves all the information to the spreadsheet

I have highlighted what I need on the VBA form in red and blue, the form is a multi-page form

Any more questions please feel free to ask

Chris NAsked:
Who is Participating?
 
Roy CoxGroup Finance ManagerCommented:
I think the form in the workbook can be used as is with maybe a few alterations.
0
 
Roy CoxGroup Finance ManagerCommented:
You haven't got room to ad boxes. I would write the entries to a ListBox when completed then write the ListBox entries to the sheet.
1
 
Roy CoxGroup Finance ManagerCommented:
In fact, I don't see the need for a UserForm, it would be much simpler to use your Data sheet.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Chris NAuthor Commented:
I don't see the point either for a userform but my boss wants it, as people weren't filling out the form correctly, so is their anyway in your opinion that I can do this via a userform, maybe if I had more pages on the userfrom to make room for the dynamic text boxes, I jut don't know how to create them during runtime of the form.
1
 
Roy CoxGroup Finance ManagerCommented:
I can't see why a UserFom would make people more likely to fill out the information. I think it's just creating work.
0
 
Chris NAuthor Commented:
Yeap totally agree, but when people don't have a clue and it looks pretty then they want it for whatever reason and won't listen to the rationale that this would be easier just using  the actually sheet, I am just trying to solve the issue with the dynamic text boxes,
0
 
Roy CoxGroup Finance ManagerCommented:
Where would you be putting the extra Textboxes?
1
 
Chris NAuthor Commented:
If you open up the userform I have highlighted the boxes in red and blue I need to be added if a cmdbutton is click the boxes would need to appear underneath the existing boxes and if the user wants to add more then those follow on from the previous.
0
 
Roy CoxGroup Finance ManagerCommented:
But there is no room for more TextBoxes unless you mean on the Patrols Tab
0
 
Chris NAuthor Commented:
Well I was think of adding more tabs to make room for the extra text boxes,
0
 
Roy CoxGroup Finance ManagerCommented:
This userform is created dynamically. There is also code demonstrating how to add various controls.
Dynamic-UserForm--2-.xlsm
0
 
Chris NAuthor Commented:
Thanks but it keep saying lstBoxData is Type Mismatched
0
 
Roy CoxGroup Finance ManagerCommented:
Here's an example I did for another post on EE. It contains code to add Labels and TextBoxes
Dynamic-Form-3.045---Sample.xlsm
1
 
NorieVBA ExpertCommented:
Couldn't you use a worksheet and make that 'pretty'?
2
 
Chris NAuthor Commented:
If only, you know when you have people who don't have a clue about how much work is involved and won't listen to a sensible solution, well I work for those people, who have seen some forms i did previously (in PHP) and then saw it can be done in VBA not having a clue what VBA means and has told me to do it. I have lost the will to live with it all, But that you Roy and thank you Norie
0
 
Chris NAuthor Commented:
Yeap I just may add drop down boxes  and put some validation in to make sure the key fields are filled out.

Thank you for all your help Roy
0
 
Chris NAuthor Commented:
Roy has come up with some great suggestions and lots of examples, thank you very much
0
 
Roy CoxGroup Finance ManagerCommented:
Pleased to help.
0
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.

All Courses

From novice to tech pro — start learning today.