Results 1 to 12 of 12

Macro stopped working - please help

Threaded View

  1. #1
    Registered User
    Join Date
    04-15-2014
    Location
    Lincoln, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Macro stopped working - please help

    Hi,

    Fairly new to Excel, but managed to create (with some help) a macro that hides all rows without any colour filled cells in it. I tried to transfer the macro to a new worksheet and it wont work any more.

    Can you please help me understand and fix what's wrong?

    Here is the macro, also I've attached the doc.

    Sub Hide_Rows()
    Dim ws As Worksheet:    Set ws = Sheets("PA Yearly Servicing Schedule")
    Dim LR As Long, LC As Long, lcell As Long
    Dim myRange As Range, rCell As Range
    Dim bHide As Boolean
    
    Application.ScreenUpdating = False
    
    LC = ws.Cells(5, Columns.Count).End(xlToLeft).Column
    LR = ws.Range("D" & Rows.Count).End(xlUp).Row
    
    For lcell = 6 To LR
        bHide = True
        Set myRange = ws.Range(ws.Cells(lcell, 5), ws.Cells(lcell, LC))
            For Each rCell In myRange
                If rCell.Interior.ColorIndex <> -4142 Then 'has color
                    bHide = False
                    Exit For
                End If
            Next rCell
        If bHide = True Then
            ws.Range("A" & lcell).EntireRow.Hidden = True
        End If
    Next lcell
    
    Application.ScreenUpdating = True
    
    End Sub
    PA Servicing schedule 12-13 kellys USE THIS.xlsm
    Last edited by kellynicolebarrett; 04-30-2014 at 08:09 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro stopped working
    By EverettRich in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-21-2013, 03:17 PM
  2. Web Scrapping Macro stopped working
    By Tejas.T in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2013, 04:00 PM
  3. Macro Stopped Working
    By andybason in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2012, 01:20 PM
  4. Macro stopped working.
    By joleen in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-06-2011, 05:37 AM
  5. Excel 2007 : Macro stopped working
    By jaw0001 in forum Excel General
    Replies: 5
    Last Post: 10-13-2010, 07:59 AM

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