VBA UserForm...

mjmartin

New Member
Joined
Mar 10, 2017
Messages
7
Hey all -I've never tried a UserForm before and I wonder if anyone would be willing to give me the proper code to make this work? I think once I see it, I'll be able to break it down and understand it, but looking for bits and pieces across the entirety of the internet is messing with my mind!!

I've got the form designed - but I'm pretty lost on the rest. If some kind soul would be willing to help, I'd be very grateful!

What I'd like to happen is this:

User launches the form by pressing a button (this much I can handle)

When the form opens, the date defaults to today's date.

The second input is a Team Member # (TM#) - what I'd like to happen is for the user to enter a five digit number, then to have that number looked up in a range on separate sheet (TeamMembers Range A:K) to have the TM Name (Column 2 in the lookup range) returned in the next box on the form. (TM Name) - if the number is not found on that page, I'd like to have a message box pop up that says "TM# Not Found" - resetting the field to blank.

The next field is "Action Type" - I'd like this to be a drop-down list box with options that are contained in a list on another sheet called DATA in column A

The next field is "Manager TM#" and I'd like that to do the same thing as was done with the "TM#" field - once the user inputs the Manager TM # - a lookup occurs in the "TeamMembers" sheet and the Manager's Name appears in the next field, "Manager Name"

The last field is a note sections. Just a plain text box.

On "Submit", I'd like all of this data to be entered into the next blank row in a sheet called "Log" and the sheet to clear, with a message box saying "Submitted to Log" - on "Cancel" I'd like the sheet to clear.


1583864245316.png
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Probably the reason you have no replies is that you are asking someone to write your project. If you make a stab at it and get specific errors then ask about them. What you are asking isnt particularly difficult and a few searches on the forum should see you on the right path. To help you along heres the date one that may need a few tweaks depending on your textbox name and the date format required.

VBA Code:
Private Sub UserForm_Initialize()

TextBox1.Text = Format(Date, "dd/mm/yyyy")

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,002
Messages
6,122,652
Members
449,092
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top