PDA

View Full Version : Need help to write a code



lcjohnson
02-11-2015, 11:32 PM
I'm wanting to create a userform that will collect course name, tee box and 18 individual hole scores, then once the submit button is pressed that information will be entered to the worksheet.

If you open the file you will see i have formulas in the fields to calculate date/entry#/scoretotal once the userform submits information to worksheet.

If you open the visual basic editor you will see the userform I have created. It's very basic and simple. 2 combo boxes and 18 text boxes, with a submit and close button.

I believe all I need to complete this little project is to code the userform to add the information to the worksheet when the submit button is pressed. And lastly, add a button to the worksheet to prompt the userform to open.

You can find the information I would like the two combo boxes to contain in the worksheet to the side. (Course Names/Tee Boxes) The text boxes will contain numbers depending on what each holes score is.

Paul_Hossler
02-12-2015, 07:05 AM
Good start !!!

I just added some initializing and linking code that you can polish the way you want

I did remove the formulas in the WS since it was easier to do it with VBA

Most of what I added was in the UF code module, but I did add a button to the WS to open the form

lcjohnson
02-12-2015, 03:31 PM
Thanks a bunch. You did an amazing job. Thanks for your help and great ideas!

Paul_Hossler
02-12-2015, 03:47 PM
No problem

There's more that you might want to consider:

1. Put the Courses' List on a separate hidden sheet and program out the hard coding
2. Use Option Buttons for Front/Back instead of a list
3. Polish the worksheet to remove too much 'Excel-ness'
4. Add some eye candy to the UserForm (but not too much, it's easy to over do it) that makes it easier to use