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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

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
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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
NorieAnalyst Assistant Commented:
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
Roy CoxGroup Finance ManagerCommented:
I think the form in the workbook can be used as is with maybe a few alterations.
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
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
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
VBA

From novice to tech pro — start learning today.