Hello,
I have some code a fellow programmer helped me out with. It does seem to work the way I want. There's just one thing Im trying to stop from happening....I have four options a user can select from in a drop down box. Right now regardless of which one of the four options you select an inputbox is triggered. I only one the input box to be triggered on two of the four options....I cant seem to fix this, was hoping someone might be able to assist. Ive tried using Appplication.EnableEvents = False to stop the inputbox, but for some reason it doesn't stop it.
In the below code the inputbox should NOT popup for Case 1 and 2, they are titled, "Working Remotely" and "Not Required"
thanks in advance!
Private Sub ComboBox3_Change()
If Changeflag = 1 Then Exit Sub
If ComboBox1.ListIndex = 1 Then
Changeflag = 1
Worksheets("Table Data").Range("C" & Range("C1").End(xlDown).Row + 1).Value = InputBox("Enter New Requirement")
ComboBox1.List = Worksheets("Table Data").Range("C1:" & Range("C1").End(xlDown).Address).Value
ComboBox1.ListIndex = ComboBox1.ListCount - 1
Changeflag = 0
End If
'Below tells the userform what to enter onto sheet 1 if the last two options in the first drop down are selected.
Select Case ComboBox1.Value
Case "Working Remotely"
TextBox1.Visible = False
TextBox2.Visible = False
TextBox3.Visible = True
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = "Employee/Contractor will be Working Remotely"
Case "Not Required"
TextBox1.Value = ""
TextBox2.Value = ""
UserForm1.TextBox3.Value = "Office Space not required for this Employee/Contractor"
TextBox1.Visible = False
TextBox2.Visible = False
UserForm1.TextBox3.Visible = True
Case "Cubical Required"
Application.EnableEvents = True
TextBox1.Visible = True
TextBox2.Visible = True
TextBox3.Visible = False
TextBox1.Value = InputBox("Enter Quantity")
TextBox2.Value = "Amount of Cubicals Required"
TextBox3.Value = ""
Case "Office Required"
Application.EnableEvents = True
TextBox1.Visible = True
TextBox2.Visible = True
TextBox3.Visible = False
TextBox1.Value = InputBox("Enter Quantity")
TextBox2.Value = "Amount of Offices Required"
TextBox3.Value = ""
Case Else
TextBox1.Visible = True
TextBox2.Visible = True
TextBox3.Visible = False
TextBox1.Value = InputBox("Enter Quantitys")
TextBox2.Value = "Amount " & ComboBox1.Value & " Required"
TextBox3.Value = ""
End Select
End Sub
Bookmarks