+ Reply to Thread
Results 1 to 4 of 4

Search in row for cell with no color

Hybrid View

lindespringer Search in row for cell with... 08-30-2019, 03:44 AM
Andy Pope Re: Search in row for cell... 08-30-2019, 03:47 AM
huuthang_bd Re: Search in row for cell... 08-30-2019, 04:11 AM
Sintek Re: Search in row for cell... 08-30-2019, 05:35 AM
  1. #1
    Registered User
    Join Date
    08-30-2019
    Location
    netherlands
    MS-Off Ver
    365
    Posts
    1

    Search in row for cell with no color

    Hi,

    Im trying to create a code that if in row D a cell has no color, it turns the value in ""
    if tryed a few ways but none worked
    here are some i tryed.
    Sub Methode1()
     Sheets("Begroting").Range ("D4:D650")
     If .Interior.ColorIndex = 0 Then
     .Cells = ""
     End If
    End Sub
    Sub Methode2()
    Dim i As Long
    With ActiveWorkbook.Sheets(1)
        For i = 100000 To 1 Step -1
            If .Cells(i, "D") = ".Interior.ColorIndex = 0" Then
                .Cells(i, "D").Value = ""
            End If
        Next i
    End With
    End Sub
    Last edited by lindespringer; 08-30-2019 at 03:54 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Search in row for cell with no color

    No fill has a colorindex of -4142 not zero

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Search in row for cell with no color

    A way to do without VBA: Filter the column by color with NO FILL and then clear the data after filter.

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Search in row for cell with no color

    Perhaps...

    Sub Non_ColorCellsClear()
    With Sheets("Begroting").Range("D4:D650")
        .AutoFilter 1, RGB(255, 199, 206), Operator:=xlFilterNoFill
        .SpecialCells(12).Value = ""
        .AutoFilter
    End With
    End Sub
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

+ 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. Search large range for fill color red, font color (various), send print command, repeat
    By safari20WDG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2016, 05:17 PM
  2. [SOLVED] Search multiple rows for cell color, return date from same column
    By OceanAngel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2014, 10:07 AM
  3. [SOLVED] keyword search - a macros to change font color for specific key words (not entire cell)
    By kingwhopper in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-10-2014, 12:25 PM
  4. [SOLVED] search, compare, and copy color of another cell
    By Jona2491 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 01-02-2013, 12:23 PM
  5. color coded or values cell search and copy
    By Macrodroid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2011, 01:22 PM
  6. Search for cell that has a formula and color cell
    By larry711 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2009, 04:22 PM
  7. [SOLVED] Can search by cell format like fill color?
    By T-Diego in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-28-2006, 07:30 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