ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Put an if statement according to cell format (https://www.excelbanter.com/excel-worksheet-functions/43290-put-if-statement-according-cell-format.html)

Melkett

Put an if statement according to cell format
 
I have a spreadsheet with approx. 10000 rows. And i would like to select and
copy the yellow rows and paste them to another sheet. Or delete cells which
are not yellow.

I think that i can do it by putting an if statement in each row and filter
them.
For example, excel will type 1 if the is yellow, else 0. Then it will be
easy to select and copy them. But how?

Or do you have any idea other than "if statement"
I need yor help. Thanks.



Gary's Student

If you are comfortable with VBA this function:

Function clr(R As Range) As Integer
With R.Interior
clr = .ColorIndex
End With
End Function

will return a number representing the background color of a cell. For
example, if you enter =clr(A1) in a cell you will have the color of the
backgroun in call A1

Good Luck
--
Gary's Student


"Melkett" wrote:

I have a spreadsheet with approx. 10000 rows. And i would like to select and
copy the yellow rows and paste them to another sheet. Or delete cells which
are not yellow.

I think that i can do it by putting an if statement in each row and filter
them.
For example, excel will type 1 if the is yellow, else 0. Then it will be
easy to select and copy them. But how?

Or do you have any idea other than "if statement"
I need yor help. Thanks.




All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com