ExcelBanter

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

Tubthumper

Hide range
 
Hi
*VB Noob*
Cells Q5:Q14 contain a data validation list; 'BLANK,1,2,3,4,5,6'
I want to hide cells A5:A14 if the corresponding selection from Q is BLANK
(the actual word, not a 'no entry'!) Choosing any of the numbers will have
no effect.

Thanks

Office_Novice

Hide range
 
Option Explicit

'Assumung your data validation list
'Dropdown is in cell A1

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.ScreenUpdating = False
If Range("A1").Value = "Blank" Then
Range("A5:A14").EntireRow.Hidden = True
Else
Range("A5:A14").EntireRow.Hidden = False
End If
Application.ScreenUpdating = True
End Sub


"Tubthumper" wrote:

Hi
*VB Noob*
Cells Q5:Q14 contain a data validation list; 'BLANK,1,2,3,4,5,6'
I want to hide cells A5:A14 if the corresponding selection from Q is BLANK
(the actual word, not a 'no entry'!) Choosing any of the numbers will have
no effect.

Thanks



All times are GMT +1. The time now is 08:35 AM.

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