1. M

    VBA: If Any Cell in a Range is Yellow Then Do Not Change Color.

    Hi, I have different ranges of cells where once a cell goes over a limit then that cell changes yellow. Once one cell changes yellow in the range I don't want the cells after to change yellow. The ColorIndex of every other cell is 24 if that's helpful. For example, in a range of F4:F7 if the...
  2. P

    VBA Entering If statement

    This one is beating me..... I have a macro on the sheet where anytime a change is made, it enters this sub. That sub works perfectly. The sub below is my problem. The sub below is highlighting cells with ColorIndex = xlNone with ColorIndex = 42 I cannot figure out why it is entering that If...
  3. J

    VBA to change background color of cell. color based on day of the month

    I have current code to change the background of the cell I updated "Today" to the color of the day. Today is the 15th of the month, so todays color is 15. What I am looking for is the "15" to change based on the day, so tomorrow the code would change to 16 without me going into the code daily...
  4. M

    Speed up selected cell fill colour macro

    Hi all, I am unsuccessfully trying to speed up my un-highlight selected cells macro. I have been toying with the code to speed it up as if I mistakenly select an entire row it takes a long time to complete. But I am too useless and have failed to get it working correctly. I have also been...
  5. A

    search and find location of colorindex = 16

    I have several locations in my spreadsheet that have merged cell location that has the colorindex of 16. I want to save the address of the different locations in my sheet that have colorindex of 16 to several variables or an array.. How can i do this? thanks
  6. S

    VBA button to filter out transparent cells

    Hi everyone, I've spent two days using my Google-fu trying to find an answer, but I'm stumped. I have a spreadsheet that I'm using to monitor the progress of a number of projects, sort of Gantt chart-style. The projects are listed down the rows and the months of the year are the columns...
  7. B

    ColorIndex formula that works with Ranges

    Hi I'm using the colorindex() formula in a work book, but i would like it to work with a sumproduct() formula aswell, for instance; Where the color index of green is 14 and yellow is 6 =SUMPRODUCT((COLORINDEX(A1:A5)=14)*(B1:B5)) Where <tbody> (Green) 15 (Green) 27 (Yellow) 62 (Green) 38...
  8. C

    Colorindex 2 vs -4142

    I'm using Excel 2016 and I'm using VBA to get the colorindex of cells using LeftColorIndex = wshScores.Range("D" & lRow).Offset(0, -1).Interior.ColorIndex in a "for loop". The sheet is set to not show grids. Some blank cells return colorindex=2 and other show colorindex = -4142. Visually...
  9. W

    Sumif function doesn't work with ColorIndex criteria

    Hi, I just found an issue concerning the Sumif function. When I enter the ColorIndex as criteria, it gives 0 as result. I tried to enter the formula in many ways, I even setup a ColorIndex function to check if the color index of the cell in criteria is actually the same as for the cells in...
  10. J

    Subscript out of range on RGB?

    I'm trying to set the interior color of a row, and for some reason I'm getting a "subscript out of range" error when I use the Interior.ColorIndex property. The goal is to mark Saturdays and Sundays in a chart. Code follows; any tips? If WorksheetFunction.Weekday(datWork, 1) = 1 Or...
  11. Y

    VBA: Using Selection.Interior.ColorIndex on multiple columns but only once a line

    Hi everyone, I would like to be able to: - use Selection.Interior.ColorIndex on several columns but only once every line. - if 1 cell (B5) on the line (5) has already been "colored" (selected) and I select an other cell (D5) one the same line then the the first cell (B5) go back to no color...
  12. R

    searching by fill color

    Hi I want to write VB code for an excel SS that searches for fill color and then performs an action based on that. For instance, if the fill color is red, delete the cell or empty it I use this code for coloring my cells: With Sheet1.Range(Cells(xx, yy), Cells(xx + 1, yy)).Interior...
  13. Gos-C

    Highlight Row if Cell Value Found in List in Other Workbook

    Hi all, I am creating a macro to open a .dat file, delete unwanted rows and highlight all rows where the specified cell value is found in a list which is located in a worksheet in the workbook containing the macro. I cannot get the VLOOKUP to work. It gives the error, "Run-time error '1004'...
  14. P

    multiple font.colorindex VBA code causing "Unresolved Content" error

    I'm using the following VBA code in excel 2007 to change the font color & bold when a word occurs within a range (rng). The range is column "L" over 618 rows. On its own it works great! it finds the word in each occurrence within range & changes the properties. Sub Bold_Stone() Dim rng As...
  15. T

    Fidgety VB Code

    I'm trying to put together a method for letting people tally up short, medium and long calls and to document the date along with those tallies. So far, I've got some code that will change the background color and leave the current date if the cell is double-clicked. The first double-click...
  16. M

    VBA issues with .ColorIndex on graphs

    I have this chart maker that makes bar charts structured with multiple series (upwards of 100) and then colors in the bars based on other criterion. I'm not going to post the entirety of my code because it's just a snippet that seems not to work. By not work, it's not that there are bugs, it's...
  17. A

    Excel Color Functions

    Hi everyone, I need one of my cells to take a certain value based on another cell's background color that is assigned via conditional formatting. Finding a function that returns the colorindex of a cell was relatively easy - the problem is that this function returns -4142 when it comes accross...
  18. A


    Hello, I am using Excel2000 on a windowsXP machine. I have the following function. Public Function testing(dataRange As Range) Dim cell As Range For Each cell In dataRange cell.Interior.ColorIndex = 8 Next cell End Function The function works fine when it is used with the 'call'...
  19. G

    Range Interior issues

    This is the code I'm using. Nothing complicated... Public Function setRangeColor(fromCellAddress As String, toCells As Range) Dim fromCell As Range Set fromCell = Range(fromCellAddress) toCells.Interior.ColorIndex = fromCell.Interior.ColorIndex setRowColor =...
  20. J

    VBA Cell color help

    Ok, this seems like it should be the easiest thing in the world, but there is obviously something critical that I'm missing. I've done a search of the forum but can't seem to find a similar issue. I'm writing a longer routine, but am running into an issue with filling the cell color. It...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back