Results 1 to 6 of 6

Hiding Rows based on the value in column A, starting at row 9

Threaded View

  1. #1
    Registered User
    Join Date
    05-06-2015
    Location
    Wales
    MS-Off Ver
    2010
    Posts
    13

    Hiding Rows based on the value in column A, starting at row 9

    Hi, so i am trying to create a macro which will hide a row if the value in the first column says "REMOVE" for the row in question, this is my code so far

    Sub Hide_rows()
        Call Worksheet_Change
    End Sub
    
    Private Sub Worksheet_Change(ByVal Target As Range)
         
        If Target.Address = "$A$9" Then
            If Target.Value <> "" Then
                Range(Rows(9), Rows(50)).EntireRow.Hidden = False
                Range("A9").Select
            End If
            If Target.Value = "DELETE" Then
                Range(Rows(9), Rows(50)).EntireRow.Hidden = True
                Range("A9").Select
            End If
        End If
         
    End Sub
    The first part unhides everything then hides the rows with the word "REMOVE" in the first column. It is currently not working, any help would be great. Note, i need to run this to the last empty row. When i try to run this i get the "compile error, argument not optional"



    Another question, i also need a separate macro assigned to different keys to unhide all cells, regardless of value

    Thank you in advance.
    Last edited by craig159753; 05-15-2015 at 10:29 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Help with hiding rows based on Column D values
    By Ellen 2Excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-15-2014, 01:58 PM
  2. Un-Hiding and Hiding Columns based on Drop-Down Values in a Column.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2011, 06:49 AM
  3. [SOLVED] Hiding rows based on a column value
    By Mark Hansen in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-09-2006, 01:40 PM
  4. [SOLVED] Hiding Rows in a Range based on column A value
    By tig in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-09-2006, 01:10 PM
  5. Hiding column/row labels --without hiding entire columns/rows
    By daniel.wolff@csfb.com in forum Excel General
    Replies: 2
    Last Post: 10-18-2005, 10:05 PM

Tags for this Thread

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