PDA

View Full Version : Hidden ActiveX Controls Disappearing



AIDSNGO
05-24-2012, 10:01 AM
Hi all,

I have a spreadsheet in which I have code like the following to make parts of the spreadsheet hide.

If target.Address = "$L$149" Then
Select Case Worksheets("Activity #2").Range("L149").Value
Case "0"
Rows("162:436").EntireRow.Hidden = True
Case "1"
Rows("216:436").EntireRow.Hidden = True
Dim a As Areas, v As Variant
Set a = Range("162:166,173:174,180:181,187:188,193:194,200:201,206:207,214:215").Rows.Areas
For Each v In a
v.EntireRow.Hidden = False
Next v
End Select
End If

It's working great, but within those rows, there are ActiveX option buttons and combo boxes that hide and reappear fine. Unfortunately, whenever I close and reopen the workbook with these controls hidden, they disappear when I reopen.

Help?!

Thanks,

AIDSNGO

AIDSNGO
05-29-2012, 01:53 PM
Hi all,

Does anyone have any ideas on this? I have put an enormous amount of time into this spreadsheet and would greatly appreciate some help in salvaging it!

Thanks!

Julien

Aussiebear
05-29-2012, 06:35 PM
Construct a Before Close event which unhides the rows

Aflatoon
05-30-2012, 04:43 AM
Are you using Excel 2010?

AIDSNGO
05-30-2012, 11:33 AM
Thanks, Aussiebear! Can you give me an idea what that would look like?

Thanks!

AIDSNGO

snb
05-30-2012, 12:23 PM
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Activity #2").Rows.Hidden = False
End Sub