The comboboxes from the control toolbox work pretty much the same way that the
dropdowns from the Forms toolbar work. But the way you change the settings is
different.
If you rightclick on a dropdown from the Forms toolbar, you'll be able to choose
format|control and on the Control tab, you can assign/change the input range and
cell link. But the cell link returns an index into that list (1 through the
number of items in your list). You need another cell with a formula to retrieve
the value chosen in the dropdown (or some code).
If you go into design mode (another icon on the Control Toolbox toolbar), you
can right click on each and choose properties.
In the properties window, you can scroll down to the ListFillRange and type in
the equivalent of the "input range". And in the LinkedCell, you can type in the
address for the equivalent of the "cell link".
And the value of that linked cell is the value that you see in the combobox from
the control toolbox toolbar.
There are lots of additional properties that you can use to make it look pretty,
too.
But if you rightclick on the dropdown from the Forms toolbar and choose Format
Control, you'll notice that it only has 4 tabs (the Control tab isn't there).
But on the Properties tab of that dialog, you'll see that there is an option to
move and size with cells. The dropdown from the Forms toolbar doesn't have that
option (it's actually grayed out) available.
So your choices are to replace all the dropdowns from the Forms toolbar with
comboboxes from the Control toolbox toolbar. Or to hide the dropdown in code.
Option Explicit
Sub HideRowsBrazil()
Dim myDD As DropDown
Dim DDVisible As Boolean
With ActiveSheet
If .Rows(141).RowHeight = 0 Then
.Rows("141:161").Hidden = False
DDVisible = True
Else
.Rows("141:161").Hidden = True
DDVisible = False
End If
For Each myDD In .DropDowns
If myDD.TopLeftCell.Row >= 141 _
And myDD.TopLeftCell.Row <= 161 Then
myDD.Visible = DDVisible
End If
Next myDD
End With
End Sub
This actually checks to see where the topleftcell of the dropdown is and then
hides/shows it accordingly.
===========
There is another option that is by far the easiest if you can use it.
That's Data|Validation. Since it's a plain old cell, it'll hide when you hide
the row.
If you've never used data|validation, start at Debra Dalgleish's site:
http://contextures.com/xlDataVal01.html
Thanks for the help...but the combo boxes are still showing.
I'm using the combo boxes from Toolbox - forms
I'm not really sure how to use the Control Toolbox - Combo boxes