Combo Boxes linked to Cells will not clear.

G

Guest

Hi, I've inherited a workbook which performs multiple functions and has input
cells and combo boxes on the first sheet (the first sheet serves as an input
page). Information is entered on this input form into cells and combo boxes,
then a button is clicked to enter the info and the macro also clears out the
input cells / boxes. This used to work fine, but something has evidently
happened and now only the cells clear out. The combo boxes stay populated.
I don't see anything in the code that has changed. Any ideas or suggestions?
Thanks!!
 
G

Guest

Oops..sorry. Below is the code, it's pretty basic. "Interface" is the first
sheet which serves as an input form. Cell E4 is linked to ComboBox3, Cell E5
is simply an input cell, and Cell E8 is linked to ComboBox5. The ComboBoxes
are placed directly over the corresponding cells, and the code is all written
using references to the cells. When you populate the combo boxes, the cells
do update (I moved one over to make sure). Everything in the workbook
functions (populating the other sheets, calculations, etc...) What is wrong
is the code clears out the cell behind the combo box, but does not update the
combo box. Is there a setting under "properties" that would fix this? Any
ideas would be great!! Thanks!!

Worksheets("INTERFACE").Cells(4, 5).ClearContents
Worksheets("INTERFACE").Cells(5, 5).ClearContents
Worksheets("INTERFACE").Cells(8, 5).ClearContents
 
G

Guest

Oops..sorry. Below is the code, it's pretty basic. "Interface" is the first
sheet which serves as an input form. Cell E4 is linked to ComboBox3, Cell E5
is simply an input cell, and Cell E8 is linked to ComboBox5. The ComboBoxes
are placed directly over the corresponding cells, and the code is all written
using references to the cells. When you populate the combo boxes, the cells
do update (I moved one over to make sure). Everything in the workbook
functions (populating the other sheets, calculations, etc...) What is wrong
is the code clears out the cell behind the combo box, but does not update the
combo box. Is there a setting under "properties" that would fix this? Any
ideas would be great!! Thanks!!
 
N

Norman Jones

Hi Clint,

Your code works for me, although it may be simplified:

'=============>>
Public Sub Tester()
Worksheets("INTERFACE").Range("E4:E5,E8").ClearContents
End Sub
'<<=============

Are you sure that there is no code behind the ComboBoxes
in the sheet Interface's module?
 
G

Guest

Thanks for taking a look Norman. The problem was - under Tools, Options,
Calculation, it was set on Manual, not Automatic. I figured out that if I
saved the worksheet after making an entry, the combo boxes cleared out. Once
I changed this to Automatic, it cleared out after each entry automatically.
Now I know for next time! Thanks again for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top