Results 1 to 5 of 5

Hide row based on value

Threaded View

  1. #1
    Registered User
    Join Date
    10-08-2015
    Location
    Gothenburg
    MS-Off Ver
    2016
    Posts
    78

    Hide row based on value

    Hey guys.

    Guess it's not so advanced but I don't manage to get it to work.
    What i wanna do is if a cell contains the value 0 I want it to hide a row, and if it contains something else then 0 (i.e 1 or 2 or 3 or 4~) I want to show the row.

    The values are filled in Sheet1 and then shown on Sheet2.

    Tried with this but doesn't work when it's on different sheets. But once in same sheet it do work.

    Also, can you write the code different if I got more cells with values I want in the same code. Post back if you miss something.


    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Range("Sheet1!B4").Value = 0 Then
            Rows("Sheet2!10").EntireRow.Hidden = True
        Else
            Rows("Sheet2!10").EntireRow.Hidden = False
        End If
    End Sub
    Last edited by Challebjoern; 05-15-2017 at 10:08 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hide Rows/Hide Columns Based on Value in Cell
    By brickwall823 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2015, 02:42 PM
  2. [SOLVED] Hide row based on cell value
    By kamaflage in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-27-2015, 10:09 AM
  3. [SOLVED] Hide Columns based on level of access e.g. if "Read Only" Hide G:G
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-16-2013, 06:10 AM
  4. Hide a row based on value
    By jjcgirl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2013, 05:37 PM
  5. [SOLVED] Hide rows based on variables that are based on formulas
    By rpinxt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2012, 06:21 AM
  6. VBA hide row based on pull down with button to toggle show/hide
    By myronr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 06:07 PM
  7. Hide a row based on a cel value
    By guillaume in forum Excel General
    Replies: 5
    Last Post: 05-18-2006, 08:15 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