Hi Everyone,
I have a small problem. I've got an excel sheet with comboboxes. I've written some VB code to restrict the use of a combobox depending on the preceding selection. The problem is that the code runs fine.. But when I create a new sheet or change a sheets name I get a 1004 error. Its not even the same sheet where the code is.. Can anyone shed some light on this for me? The code is below.
Private Sub ComboBox2_Change()
If Sheets("InputSheet").ComboBox2 = "Years" Then
Sheets("InputSheet").ComboBox3.Enabled = False
Sheets("InputSheet").ComboBox3.Value = ""
End If
If Sheets("InputSheet").ComboBox2 = "Quarters" Then
Sheets("InputSheet").ComboBox3.Enabled = True
End If
If Sheets("InputSheet").ComboBox2 = "" Then
Sheets("InputSheet").ComboBox3.Enabled = False
End If
End Sub
Thanks in Advance and Enjoy your day
Bookmarks