Results 1 to 9 of 9

Hide/Unhide row based on cell value

Threaded View

  1. #1
    Registered User
    Join Date
    07-10-2019
    Location
    Nova Scotia, Canada
    MS-Off Ver
    2013
    Posts
    4

    Hide/Unhide row based on cell value

    Hi, I am very new to writing VBA so for many of you this will most likely be a very simple question. I want to hide/unhide rows based on whether or not a cell have a value in it.
    If L18 in blank then Row 171 is hided; if L19 is blank then Row 172 is hidden and so on to L168. I have it working for one cell/Row but how do I set it to do this for the range?
    Here is what I have:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    Application.ScreenUpdating = False
    
    Select Case Range("L18").Value = ""
    
    Case True: Rows("171").Hidden = True
    
    Case False: Rows("171").Hidden = False
    
    End Select
    
    End Sub
    Last edited by jeffreybrown; 07-11-2019 at 12:46 PM. Reason: Please use code tags!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Auto hide/unhide based on cell value
    By erice in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-09-2018, 04:35 PM
  2. How to Hide-Unhide Row Based on a Cell Value
    By putritersenyum in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2015, 06:56 AM
  3. [SOLVED] Hide and unhide text box based on a cell value - 2
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2015, 06:59 PM
  4. [SOLVED] VBA Code to hide and unhide based on a cell value
    By Silver13 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-23-2015, 03:00 PM
  5. [SOLVED] Unhide and Hide row(s) based on value in a cell in the row above
    By jammi1710 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-18-2014, 01:27 AM
  6. Hide & Unhide columns based on a cell value
    By DaveNUFC in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-21-2010, 09:40 AM
  7. hide/unhide rows based on cell value
    By alexandruc in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-12-2009, 06:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1