+ Reply to Thread
Results 1 to 2 of 2

Macro to Hide or Delete Rows is not Consistance -- Please help

Hybrid View

  1. #1
    Registered User
    Join Date
    01-07-2016
    Location
    Seattle, Washington
    MS-Off Ver
    2013
    Posts
    1

    Question Macro to Hide or Delete Rows is not Consistance -- Please help

    I have written a simple macro to hide rows in a spreadsheet that contain certain text in a the column. It runs fine but doesn't consistently hide all of the rows. Sometimes I have to run it multiple times in order for it to work. Why would this be? Does anyone have any suggestions for more robust code? My code is as follows...

    Sub Hide_Rows()

    Dim Cell As Range
    For Each Cell In Range("M6:M600")
    If Cell.Value = "BUG" Then
    Cell.EntireRow.Hidden = True
    End If
    Next

    End Sub

    Thank you!
    Scott

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Macro to Hide or Delete Rows is not Consistance -- Please help

    Please use code tags around your code.
    Choose to edit your post, select all the code, click the # on the toolbar and then choose to save your changes.
    Your code will then look like this.
    Sub Test()
    End Sub

+ 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. Macro that will delete/hide rows based on a cell value
    By dwilkinson12 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-27-2014, 05:59 AM
  2. 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
  3. [SOLVED] Is it possible to a macro go row by row and hide (or delete) and rows where column 1 is ""
    By CDNcameron in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2013, 02:14 PM
  4. Delete vs Hide rows code not working
    By cxc300cxc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-22-2013, 03:41 PM
  5. Can't Delete Hide Rows
    By mohan.r1980 in forum Excel General
    Replies: 4
    Last Post: 01-31-2012, 06:42 AM
  6. macro to delete (not hide) rows and resort
    By jrtaylor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2009, 06:09 PM
  7. Automatically hide or delete empty rows after IF ?
    By Lost! in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-02-2005, 05:13 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