Cell fill colour optionally not to print - excel

I have a protected worksheet and keeping few cells are editable to user.
Which is filled with a green colour to indicate the user can edit the cell.
But at same time I want to print these cells without the background colour.
If I choose the option in page setup 'Print : Black/White'
, other cells, which i want to preserve the colour fill for, are also cleared e.g.
the top row (heading) is filled with a grey colour and the Total has a dark grey colour.

Conditional Formatting would be your best bet.
Otherwise I would use VBA to do this. I've done this by creating a print button and assigning it to a print macro.
The macro would consist of two functions:
Range(xxx).Interior.Color = xlNone
ActiveSheet.PrintPreview

Related

How to change the background of a cell in excel, by using a formula, no Conditional Formatting

I have a column with numbers 0 to 100 and I want to change the background colour of the next column according to those values
with 0 as red, and 100 as normal green
and as the number gets higher, the colour fades from red to light red, to white in 50 and then, light green to green in 100
The question is how do I do that, without using conditional formatting
I was trying to use ColourIndex, as
=Range("A1").Interior.ColorIndex = RGB(255,0,0)
but the function is not working, and I do not want to use conditional formatting
Any ideas?
If you don't want to use conditional formatting, your only other avenue is VBA. But this can easily be done with ONE SINGLE conditional format applied to the range of 100 cells.
If you want to format the column to the right of the original values, use a formula to pull the values from the column to the left, then apply a color scale conditional format to the target column.
Set a custom number format of ;;; to hide the numbers in the formatted column.
Answering your question as stated in your title (How to change the background of a cell in excel, by using a formula, no Conditional Formatting) - You can't. Not with a worksheet formula.

How to use filter option for no fill

I would like to know the excel VBA coding for the below scenario.
I have highlighted the cells in yellow color that matches my condition and now i want to filter the no fill cells. But, the bad part is there is no cell that doesn't matches my condition and thus there is no cells without yellow color. which doesn't show the no fill option in the filter drop down.
How can i able to get the data of those no fill cells.
Change a color of one cell to empty (no color)
Start recording a macro
Select the filter for no color
Stop recording macro
Change color of cell to yellow again
Run recorded macro

Sort column and rows using color showed in image in Microsoft Excel

I Posted one picture here. I want to do some filtering functionalities. If I do a click on yellow color in sheet then it will show only yellow color cells and other cell won`t show up . Any Idea How can I do this ?
Thanks in Advance .
As far I know, you are unable to hide individual cells in excel, however you can "hide" cells by either deleting its contents, or making its contents white/invisible.
Hiding Individual Cells
If this is OK for you, I would create a:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
and get the cell's color:
ActiveCell.Interior.Color
and then iterate through all other cells:
Iterating Through Cells
deleting cell contents/changing font color if the cell color does not match the defined color.
You may be able to first sort the cells by color, so that all identical colors are in the same row, and then when you run through the cells, you can just hide the whole row if any cell in it is the incorrect color.
This is obviously not a complete solution, and you would have to change some things around for it to work for your needs.

LibreOffice Calc: Is there a possibility to copy a background color from another cell?

I have created a table that has a value on one column that I have used to generate a background colour (Format -> Conditional Formatting -> Color Scale... -> Colour Scale). Now I would like that all the row to have that colour. Is it possible to copy the background colour from another cell?
EDIT:
So this is my table:
And what I want is to colour all the cells from class group with the same colour as its total group.
Meaning that for the class 101 I want all the cells to have the same yellow-orange as the cell containing 592:
(this is done manually)
I want this to be some kind of formula, so any change in the last column is going to change all the colours. Is it possible?
Set the condition of each cell in a row to be the same as the condition you used for "total_group" cell in the same row. Meaning base the condition on the value of the "total_group" cell (Exact same condition no changes)
I found a simple workaround that effectively is a copy color operation:
Select the source cell. This will place the color of the cell into
the "recently used" section of the background color tool.
Select the target cell.
Select the color from the background color tool, where it is now easy to find in the "recently used" section.
The background color tool is next to the font color tool. The above method works in libreoffice 7.3

Excel 2007 drop-down list that effects the cell's color but not the content

I have searched for this solution and I have found many drop-down lists that can change the color and the data of the cell or change the color depending on what data is entered.
What I would like to do is have a cell with a number inside (#'s 1-10) and also have a drop-down list (pass, fail, marginal) and depending on which item from the drop-down list is selected it would change the cell's background color to red, green, or yellow, from it's default of white.
Any help would be appreciated. Thanks!
You can use conditional formatting to achieve the same. For the cells with numbers add conditional formatting
Home -> Conditional formatting -> New Rule
Select Use a formula to determine which cells to format. Now you set a formula here. You can refer to drop-down list value here to set format. (eg: if column A has numbers and column B has the drop-down, you can set the formula as =$B1="Marginal" and set the formatting.
Hope this helps.
Screenshots for reference:
I think I've found the best solution for this situation:
I had two cells side by side. One with the data and one with the drop-down box. The two cells bordered together so that they appear as one cell (even though they aren't). I then put two separate conditional formats on the two cells. The conditional format of the data cell changed the background color of the cell based on the value of the drop-down box cell. The conditional format of the drop-down box cell changed the background and text color to the same color as the other cell (to blend in) depending on its own value.
When the two cells were bordered and spaced correctly they appear as being one cell with one value. Quite a bit of work with the formatting and all but I think this may be the best option for this situation.
Thanks again, Konstant for your help. :)

Resources