ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   hiding cells then a button to get them back up again? (https://www.excelbanter.com/excel-discussion-misc-queries/127310-hiding-cells-then-button-get-them-back-up-again.html)

[email protected]

hiding cells then a button to get them back up again?
 
how do i hide a selection of cells and then have a button to bring them
back up again? as in an action button that says "SHOW" and when you
click it, the cells you've hidden will show up. many thanks


Dave F

hiding cells then a button to get them back up again?
 
You need VBA code.

Here is an example of such code. You will need to change the cell
references below to suit your needs.

Sub TCAPSfcst()
' Hides rows 85:159
' Hides columns AJ:CN
' Freezes window at H4
Cells.Select
Range("B1").Activate
Selection.EntireRow.Hidden = False
Selection.EntireColumn.Hidden = False
Rows("85:159").Select
Selection.EntireRow.Hidden = True
Columns("AJ:CN").Select
Selection.EntireColumn.Hidden = True
Range("H4").Select
ActiveWindow.FreezePanes = False
ActiveWindow.FreezePanes = True
End Sub

This macro is then associated with a button. Post back if you have questions.
--
Brevity is the soul of wit.


" wrote:

how do i hide a selection of cells and then have a button to bring them
back up again? as in an action button that says "SHOW" and when you
click it, the cells you've hidden will show up. many thanks




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

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