PDA

View Full Version : Solved: Make list boxes visible=False



zennon
05-09-2007, 06:34 AM
Afternoon,

On my attachment, I need to hide/unhide the Extra fields part of the form on the Headers sheet when the More Fields button is selected ans again to hide them when the Close Extra Fields button is pressed.

Any help will be gladly accepted.

Thanks

Dave

Bob Phillips
05-09-2007, 06:47 AM
Sub more_buttons()
SetVisibility True
End Sub

Sub close_extra()
SetVisibility False
End Sub

Private Sub SetVisibility(ByVal State As Boolean)

With ActiveSheet
.GroupBoxes("extra").Visible = State
.Labels("exlab1").Visible = State
.Labels("exlab2").Visible = State
.Labels("exlab3").Visible = State
.Labels("exlab4").Visible = State
.Labels("exlab5").Visible = State
.Labels("exlab6").Visible = State
.Labels("exlab7").Visible = State
.Labels("exlab8").Visible = State
.Labels("exlab9").Visible = State
.DropDowns("exdrop1").Visible = State
.DropDowns("exdrop2").Visible = State
.DropDowns("exdrop3").Visible = State
.DropDowns("exdrop4").Visible = State
.DropDowns("exdrop5").Visible = State
.DropDowns("exdrop6").Visible = State
.DropDowns("exdrop7").Visible = State
.DropDowns("exdrop8").Visible = State
.DropDowns("exdrop9").Visible = State
.Buttons("exbutton").Visible = State
.Buttons("exsend").Visible = State
End With
End Sub

zennon
05-09-2007, 06:53 AM
Thanks, Works great.

Thanks for the help