Hi!
I'm a novice at VBA. I've created a User Form for people who are not experienced with Excel and I'm having a couple of problems.
1) The form includes text boxes as well as pull-downs (combo boxes). I was wondering if there was a way to use input masks (like in Access) to prevent uses from entering inappropriate data. For example, I have several date fields. Is it possible to have my user form already have a mm/dd/yyyy format for them? Or, if that's not possible, is there some way to make the User Form beep at them? I have prompts in the labels next to the boxes, but I'm afraid it won't be enough.
2) I'm also having problems with errors that my form is producing. If you click outside of the form boundaries or hit enter in some cells, there's an error with my Ok to quit statement:
Private Sub UserForm_Click()
Private OKToQuit As Boolean ' determines if button pressed to exit
End Sub
Private Sub Cancel_Click()
OKToQuit = True
Me.Hide
End Sub
Private Sub Apply_Click()
MsgBox "Button pressed; Apply choices"
OKToQuit = True
Me.Hide
End Sub
3) As I said, I've got combo boxes, but they let you type in them. Is there a way to make this NOT happen?
4) I don't understand the use of If statements in the code. For example, I have a particular yes/no question. If the user enters YES, I'd like them to enter a date in the next box. If either NO is entered or there's no information, I'd like to have that text box turned off. Is this possible?
Again, I'm really just learningthis, so your patience is appreciated. Or, I'm happy to share this with someone if that's easier ~ please leave me your email address.
Thanks!
Marianne
I'm a novice at VBA. I've created a User Form for people who are not experienced with Excel and I'm having a couple of problems.
1) The form includes text boxes as well as pull-downs (combo boxes). I was wondering if there was a way to use input masks (like in Access) to prevent uses from entering inappropriate data. For example, I have several date fields. Is it possible to have my user form already have a mm/dd/yyyy format for them? Or, if that's not possible, is there some way to make the User Form beep at them? I have prompts in the labels next to the boxes, but I'm afraid it won't be enough.
2) I'm also having problems with errors that my form is producing. If you click outside of the form boundaries or hit enter in some cells, there's an error with my Ok to quit statement:
Private Sub UserForm_Click()
Private OKToQuit As Boolean ' determines if button pressed to exit
End Sub
Private Sub Cancel_Click()
OKToQuit = True
Me.Hide
End Sub
Private Sub Apply_Click()
MsgBox "Button pressed; Apply choices"
OKToQuit = True
Me.Hide
End Sub
3) As I said, I've got combo boxes, but they let you type in them. Is there a way to make this NOT happen?
4) I don't understand the use of If statements in the code. For example, I have a particular yes/no question. If the user enters YES, I'd like them to enter a date in the next box. If either NO is entered or there's no information, I'd like to have that text box turned off. Is this possible?
Again, I'm really just learningthis, so your patience is appreciated. Or, I'm happy to share this with someone if that's easier ~ please leave me your email address.
Thanks!
Marianne