+ Reply to Thread
Results 1 to 3 of 3

# Hide rows if certain cell is...

  1. #1
    Registered User
    Join Date
    10-15-2014
    Location
    Copenhagen
    MS-Off Ver
    201, 2013, 365
    Posts
    26

    Exclamation # Hide rows if certain cell is...

    Hi

    I worte this VBA code, should be easy but nothing is today :-(
    I want to hide row 35:38, if cell D34 is text "Nej"

    What am I doing wrong ??

    / Kristian


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,105

    Re: # Hide rows if certain cell is...

    What is Target.Address in your current Sub? This looks like it was once a Worksheet Change Event that was then converted into a regular Sub procedure. Reframe it as a change event and it should work:

    Please Login or Register  to view this content.

    Edit: If you don't want this to be a worksheet change event because you'd rather attach it to a button or something, then you'll just need to define "Target" (I would advise changing the name in this case) as a range and set it as oSheet.Range("D34")
    Last edited by CAntosh; 05-10-2017 at 12:37 PM.
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: # Hide rows if certain cell is...

    Or if you don't want event code:

    Please Login or Register  to view this content.

+ Reply to Thread

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. Need Toggle Button to hide/unhide rows based on cell value in non concurrent rows
    By The Phoenix in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-13-2015, 10:49 AM
  3. [SOLVED] First unhide all rows - then hide rows based on specific cell value for a range of cells
    By robbiekh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2013, 05:46 PM
  4. Hide Rows with a Value (2 values to hide) then delete visible rows
    By Slea in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-19-2013, 06:25 AM
  5. Hide multiple rows below target cell based on a cell value match elsewhere.
    By tapmagoo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2013, 12:37 PM
  6. Hide rows with cell value = 0
    By 95marine in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2012, 02:40 PM
  7. Using check boxes to hide and un-hide rows with drop down lists within rows
    By Sparky_Chris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2012, 07:22 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