ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide sheet (https://www.excelbanter.com/excel-programming/405310-hide-sheet.html)

ranswert

Hide sheet
 
How do I write a procedure that will hide the worksheet except for a certain
range of cells?

Nigel[_2_]

Hide sheet
 
You can of course hide entire columns and rows, but that means you have to
have a rectangular collection of cells on show.

You could consider masking the cells, set background and foreground colors
the same, lock these cells, unlock the cells you want to show (if need you
need to edit) and then protect the sheet.




--

Regards,
Nigel




"ranswert" wrote in message
...
How do I write a procedure that will hide the worksheet except for a
certain
range of cells?



Don Guillett

Hide sheet
 
Sub hidenonused()
With Range("a1:b12")
lr = .Rows.count + 1
'MsgBox lr
lc = .Columns.count + 1
'MsgBox lc
'MsgBox Columns.count
End With
Rows(lr & ":" & Rows.count).Hidden = True
Range(Cells(1, lc), Cells(1, Columns.count)).EntireColumn.Hidden = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"ranswert" wrote in message
...
How do I write a procedure that will hide the worksheet except for a
certain
range of cells?




All times are GMT +1. The time now is 03:47 PM.

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