View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Combobox problem

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
if application.CountA(Range("A1,B9,C13,D21") < 4 then
me.combobox1.enabled = False
Else
me.Combobox1.enabled = True
End if
End Sub

--
Regards,
Tom Ogilvy

Ian Coates wrote in message
...
I have a combobox which changes certain cells on a spreadsheet depending

on
the CB selection and the content of several other cells. The problem I

have
is that if one particular cell does not have a value entered, the data in
the code assumes a certain set of conditions. If data is then entered in

the
cell, the other data is not corrected as it depends on CB LostFocus.

Is there a way to disable the CB but still leave it visible until certain
cells in the sheet are populated? I know about the Enabled property, but

I'm
not sure how to detect the presence of data in particular cells except

from
within a subroutine. I suspect I need to use the Worksheet

SelectionChange,
but I only want the code to test conditions when particular cells are
changed.

Am I being thick, here?