+ Reply to Thread
Results 1 to 12 of 12

Macro stopped working - please help

  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.

    Please Login or Register  to view this content.
    PA Servicing schedule 12-13 kellys USE THIS.xlsm
    Last edited by kellynicolebarrett; 04-30-2014 at 08:09 AM.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Macro stopped working - please help

    first you need to put your code between code tags because it creates problems for mods who are working day in and day out to keep the things clean at the same time it's difficult to understand. See forum rule for how to add code tags

    You can add code tags by clicking # then inserting code in between code tags
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Macro stopped working - please help

    1) please edit your post and use code tags as required by http://www.excelforum.com/forum-rule...rum-rules.html
    2) in your worksheet there is a lot of cells which have not empty fill -4142 but white color (index = 2)
    Please Login or Register  to view this content.
    could be the cure
    3) moreover LC is calculated wrong way - have a closer look into your sheet (for instance columns GG and others to see why).
    4) see p.1 and do edit your post.
    Best Regards,

    Kaper

  4. #4
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Macro stopped working - please help

    As you are copying code to a new worksheet and it is not working I think you need to change sheet name just change the red part to the name of the sheet
    Please Login or Register  to view this content.

    do edit your post
    Last edited by hemesh; 04-30-2014 at 05:50 AM.

  5. #5
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Macro stopped working - please help

    As you are copying code to a new worksheet and it is not working I think you need to change sheet name just change the red part to the name of the sheet
    Please Login or Register  to view this content.
    do edit your post

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

    Re: Macro stopped working - please help

    ok, thanks for the tip I've used the tags on my code (see above post)

    I did actually change my sheet to the same name as the old one, I thought that would solve it but it didn't.

  7. #7
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Macro stopped working - please help

    you need to change the sheet name to the sheet where you want to use it or use
    Please Login or Register  to view this content.

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

    Re: Macro stopped working - please help

    kaper you are right with the below

    3) moreover LC is calculated wrong way - have a closer look into your sheet (for instance columns GG and others to see why).

    With that in mind, is it possible to set it so that it shows only rows with green or red filled cells?

  9. #9
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Macro stopped working - please help

    Try:
    Please Login or Register  to view this content.

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

    Re: Macro stopped working - please help

    I know what the problem is, but have no idea how to solve it. As an example if I click on my "february" button it hides all my columns except feb's. When the macro looks for rows with no fill colour to hide, it is still picking up the colour in the hidden rows. In this example, I basically want to see only the servicings (coloured cells) due for february. And the same for any month that I filter.

    Is there a way around it to have an altered macro on each month that only searches through the relevant columns (so for Feb H-K). So it would hide all rows with no fill colour in H-K?

  11. #11
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Macro stopped working - please help

    Try to limit your myRange to only visible columns:
    Please Login or Register  to view this content.

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

    Re: Macro stopped working - please help

    kaper you legend! That works perfectly. Thanks so much. And thanks to hemesh for your replies.

+ 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 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