+ Reply to Thread
Results 1 to 14 of 14

code for deleting rows with fill color

  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    70

    code for deleting rows with fill color

    hello guys!

    I would like to ask how to code if you want to delete all rows with fill color for an entire excel file with several worksheets?

    Thanks in advance!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: code for deleting rows with fill color

    Yes its possible.

    Which is the column which has the fill color and which fill color?

    Any worksheet to be excluded from the code?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    01-29-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: code for deleting rows with fill color

    There is no specific fill color. No worksheet to be excluded.
    Rows are to be deleted (not column) and there is no specific place. The places of rows with fill color vary with every worksheet.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: code for deleting rows with fill color

    The entire row has a fill color which needs to be deleted? So any and all fill colored rows to be deleted?

  5. #5
    Registered User
    Join Date
    01-29-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: code for deleting rows with fill color

    Yes yes.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: code for deleting rows with fill color

    Hello moniquem,

    Here you go,

    Please Login or Register  to view this content.
    Also see the "Please Consider" note at the bottom of this post.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  7. #7
    Registered User
    Join Date
    01-29-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: code for deleting rows with fill color

    Hi, Winon!

    Do I need to edit anything? It's not working for my file.

    Thanks for the response.

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: code for deleting rows with fill color

    Hello moniquem,

    Try the attached WorkBook, and see if you can use the code in your WorkBook.

    HTH.
    Attached Files Attached Files
    Last edited by Winon; 03-01-2013 at 01:00 PM. Reason: Improved and corrected Sample Workbook

  9. #9
    Registered User
    Join Date
    01-29-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: code for deleting rows with fill color

    It works! Thanks, Winon! Your help and kindness are very much appreciated. Thanks a lot!

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: code for deleting rows with fill color

    Hello moniquem,

    You are welcome.

    Glad you could get it to run with your WorkBook.

    Thank you for the "Rep".

  11. #11
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,719

    Re: code for deleting rows with fill color

    @ Winon
    What happens if a cell is colored white?

    Should that not be

    Please Login or Register  to view this content.
    ???

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: code for deleting rows with fill color

    @ jolivanes,

    No, I have tried that, and it does not work. It also clears Data in rows without any color, and leaves behind at least one colored Cell on one or more sheets.

    In any case, if a Cell is colored white, it would appear as if it is the same as the background color of the Sheet, which is white. If the OP would change the background color of the sheet, it would require an entirely different approach and Coding.

  13. #13
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: code for deleting rows with fill color

    @ jolivanes,

    Sorry, jolivanes!

    Please ignore my post above. Your suggestion works fine, I have just "tested" it incorrectly.

  14. #14
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,719

    Re: code for deleting rows with fill color

    @ Winon,
    No problem, glad it worked.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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