ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hiding controls with rows (https://www.excelbanter.com/excel-programming/316102-hiding-controls-rows.html)

Rob Standefer

Hiding controls with rows
 
I have several controls in a named range. When I hide the range, the
controls all roll up on each other and aren't hidden (the same thing
happens if I delete the range).

I'm using this code:

Me.[RangeName].Rows.RowHeight = 0

Any suggestions on how I can get the controls to hide too? They are
Excel forms controls, not ActiveX.

Thanks,
Rob

Dave Peterson[_4_]

Hiding controls with rows
 
Can you switch to the controls from the contol toolbox toolbar?

If not, how about going through the sheet's shapes and checking to see where
they're located. If it's in that range, then hide that shape:

Dim myShape As Shape
Dim myRng As Range
Set myRng = Me.Range("myRangeNameHere")
myRng.Rows.RowHeight = 0
For Each myShape In Me.Shapes
If Intersect(myShape.TopLeftCell, myRng) Is Nothing Then
'do nothing
Else
myShape.Visible = msoFalse
End If
Next myShape


You'll need the opposite to show the shapes/rows.


Rob Standefer wrote:

I have several controls in a named range. When I hide the range, the
controls all roll up on each other and aren't hidden (the same thing
happens if I delete the range).

I'm using this code:

Me.[RangeName].Rows.RowHeight = 0

Any suggestions on how I can get the controls to hide too? They are
Excel forms controls, not ActiveX.

Thanks,
Rob


--

Dave Peterson



All times are GMT +1. The time now is 05:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com