Check Cells For Color Index And Delete

Jul 25, 2008

I am trying to write some code and I am lost.

Column Y-has Y, N entered in cells
Column R-has 1,2, etc... entered in cells (some cells have color index 26)
Column O-has 1, 2, etc... entered in cells (some cells have color index 3)
Column G-has names entered entered in cells (some cells have color index 38)

I need the macro to check if Column Y has a "N" and then if it does check Column R, O, G and if there is no color index in any of the Columns the macro will delete the row.

If Column Y has a "N" but Column R, O, G has a color index it will not delete the row.

There are 3000 rows on the spreadsheet and the macro would need to go through all the rows.

View 14 Replies


ADVERTISEMENT

Formula Check The Color Index Of A Cell

Oct 12, 2006

Is it possible to have a formula check the color index of a cell?

Example if A1 color index = 6 then X

View 9 Replies View Related

Sum Cells Based On Color Index

Nov 13, 2006

I am trying to use a function kindly listed by Dave, that allows for a SUM to be done on cells which have a certain color index. I have modified it very slightly, but unable to set the call to it without getting errors, perhaps someone can shed some light on what i am doing wrong. Dave's original code is

Function ColorFunction(rColor As Range, rRange As Range, Optional SUM As Boolean)
Dim rCell As Range
Dim lCol As Long
Dim vResult
lCol = rColor.Interior.ColorIndex
If SUM = True Then
For Each rCell In rRange
If rCell.Interior.ColorIndex = lCol Then
vResult = WorksheetFunction.SUM(rCell,vResult)
End If
Next rCell
Else
For Each rCell In rRange
If rCell.Interior.ColorIndex = lCol Then
vResult = 1 + vResult
End If
Next rCell
End If
ColorFunction = vResult
End Function.......

View 4 Replies View Related

Check Text In Cells And Delete And Add Column Accordingly

Nov 1, 2009

I receive thousands of raw data every week as shown in the excel sheet {raw data}

I would like to use a macro that could automatically sort the raw data like the format in the excel sheet {template}

For example:

Looking at the raw data and compare with the template, i would have to delete the whole columns that have (BU_CODE , EAN_CODE, SUPPLIER_CODE, SUPPLIER_NAME , BRAND_NAME, and SUB_CATEGORY_CODE) and add in columns and name it as Principal, Cateogry , Brand and range).

View 7 Replies View Related

Check If Cells Are Empty If So Delete Range?

Jul 25, 2012

im having a little trouble writing a macro to :

check if a7:t7 is empty, if so delete a6:t7 and change cell colour of a6:t7 to 'no fill'

View 2 Replies View Related

Delete Cells By Color

Jun 28, 2007

I need to delete ALL black text cells, and only keep colored ones.

[url]

ignore the circles, because I now want to delete ALL black text fields.

In addition, I need the cells shifted up. So it should do the same thing as Right Click --> Delete --> Shift Cells Up --> OK.

Is there any way I can do that with a command or macro? And if so, can you PLEASE tell me how to do that real quick?

View 9 Replies View Related

Code To Delete Cells Without Fill Color

Jan 25, 2013

I am looking for code that would delete all columns in a worksheet that do not contain a fill color.

View 9 Replies View Related

Auto Delete Cells Which Is Filled With Color

Oct 12, 2008

vba to auto delete cells which is filled with color. e.g if from c39 to d39 is filled with lavender i want a vba to delete cell c39 to h39 until all cells with lavender is deleted. If there are other threads like this please direct me.


0.00 00 0.00 00 0.00 00 0.00 00 0.00 00 0.00 00 0.00 00

View 9 Replies View Related

Delete Cells Based On Fill Color

Mar 11, 2008

how to sum/count cells based on background color [url]

how to delete cells based on background color?

View 3 Replies View Related

Excel 2010 :: Use Range Of Cells With URLs To Files And Check It They Exist - If False Delete To End?

Oct 24, 2013

This is Excel 2010 on Windows 7

Trying to figure out a VB Script but don't know where to start.

I have a sheet for each month. lets take September 2013

A Column with 200 Servers (A1:A200) on the Intranet listed as server-1/, Server-2/ Server-3 ... Server-200/
Each Server lists a location of a file for each day (31 columns per row)

I am trying to check for the existence of the files on each server (The Cells contain the URL and File Name in Range B2:AF201) starting with server-1 check the URL in B2 if it exists, go to C2, Continue with that row until the file check is False (The Page will show a 404 error) if not found delete cell url and continue. do this for all 200 rows

View 3 Replies View Related

Index + Match With Another Check

Sep 1, 2009

the table look as follows;..........

Meaning. Cell A1 (A) gets a match then checks in the same row on column two matching with another table B1 (2).. if both cells in both columns are matched, then C1 (55) will be returned. =INDEX(C:C;MATCH(A1;A:A;0);MATCH(A2;B:B;0)). I can sort the whole table and use vlookup, but how can i make it without sorting ?

View 2 Replies View Related

Add The Color Index Into A Column

Mar 19, 2007

i would like to add some sorting code by colors and i need to add the color index into a column in the same file + below formula = colorindexofcell(a1,false,true) i need to exclude 2 columns for deleting the report.To reason for that everyday we run the report and next time there are new entries and report needs to be run again

when i double click anywhere on report sheet it deletes the colorindex and formula column as well is there anyway to modify below code by excluding two rows such as "ag" and "ah" column,for deleting process

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Call Delete_Report

Range(Range("a1"), Cells(Cells.Rows.Count, 1).End(xlUp)) _
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
unquote

View 9 Replies View Related

Font Color Index

Apr 23, 2007

I have a spreadsheet which has some cells with blue font. If anyone tries to manually change the contents of these cells a worksheet change macro reads the colour index of the font and, if it is 5 (blue), uses "application.undo" to repair the damage.

When I use the sheet on another computer, the same font colur is being read as a four digit number, 4015 I think from memory, and the code doesn't work.

View 9 Replies View Related

Default Border Color Index

Jun 18, 2009

When I launch excel 2007, i have cells with a grey border. I'm not sure what the colorindex is of this border.

Through a macro, when I format cells, I use

Cells(x,y).BorderAround ColorIndex:=xlAutomatic

xlAutomatic points to BLACK by default. Could someone tell me how I could reference the actual default colorindex (the grey one which seems to border all other cells, while not being xlAutomatic)?

View 2 Replies View Related

Find Index Number Is The Color Of Red

Apr 17, 2009

I am editing code that changes a cell's forecolor and I can't seem to find the number for red. What number is red

View 9 Replies View Related

If Any Cell Is (red) Has A Color Index Of 3, Bring The Whole Row To The Top

Jul 9, 2009

I have a worksheet with several columns and 1,000's of rows. I have code that makes all "good cells" grey (color index 15) and all "bad cells" red (color index 3).

I would like to do 2 things...

1. If ANY cell is RED, cut the WHOLE ROW and "insert cut cells" below the header row (even if ALL other cells are grey), then repeat the process up the whole worksheet until ANY row with a red cell is at the top.

2. Create a new worksheet named "Trouble Cells", copy the header row along with any rows with red cells.

I would like to keep the formatting the same (for example, the title row is always yellow and is "28" high and all other rows are a height of "12").

I would also like to keep the column width of each column in the new worksheet as well.

Excel 2002

View 9 Replies View Related

Copy Row Based On Color Index

Oct 20, 2006

to loop through each row in sheets("Layer Layout") and check if there are any red fonts in its cell..If there is, i need to copy the header ("A1") and the rows containing the red fonts to sheets("Report")..

View 9 Replies View Related

Loop Through Range By Color Index

Jun 16, 2007

I have a bit of VBA code that loops through a range and looks at the color index. If it is color index three then it will put a "1" in the cell six columns over. This code works, but I see over and over again that loops are bad and inefficient. Since I am working on my code being more efficient I wanted suggestions for altrenate code that would do basically the same thing.

Dim Bcell As Range
For Each Bcell In Range("D2:D304")
If Bcell.Interior.ColorIndex = 3 Then
Bcell.Offset(0, 6) = "1"
Else
Bcell.Offset(0, 6).ClearContents
End If
Next Bcell

View 4 Replies View Related

Index And Match To Check Data And Provide Exception Results

Mar 25, 2014

Currently i am using index and match in excel but however i am unable to get the result tt I want.. what i need is

Data to check with item master whether all 3 (article, color code and size) matches and if it doesn't match, which of the field is wrong. (eg: wrong color code, wrong size or article don't exist).

[Code] .......

Above is my item master

Data to check

[Code] ........

Example case: 1

Checking first row of data check

Article number: 2-50660147

Color code: 6

Size: M

Result: "Wrong size"

But however, it returns as wrong size as it only reads the first time the article number appear in the item master and does not recognize the second time the article number appears with the correct color and size.

View 9 Replies View Related

Check Color And Use

Jul 13, 2007

I want to use "If" function to check "color" :

If (Color is yellow,sum(a1:B5),sum(d1:d8))

View 9 Replies View Related

VBA Check If A Cell Is Empty - Move 7 Cells Over And Check Again (Loop)

Aug 10, 2012

I have data in Row 53 that spans 7 columns, but stays in the same row. I want to design a loop to select every 7th cell in that row and check if it is empty. If not, add onto a "counter" then display the final number of occupied cells (the value of the counter) at the end. This is what I have so far, but I get all sorts of errors.

Code:
Sub Tester()

Dim WB As Workbook
Dim WS As Worksheets
Dim modCounter As Long
Dim Cell As Range

Set WB = Workbook("Transverse Series.xlsm")
Set WS = WB.Sheets(BM18)

[Code] ......

View 1 Replies View Related

Find String Of Text Plus Cell Index Color?

May 3, 2013

I am trying to come up with a macro that will search a range for a specific string of text plus Interior.ColorIndex = 4. The range can have the text in it multiple times but i only want the macro to fire the next line of it if the cell address also has that color. Is there a way that can be done? My code below stops after it finds its first occurrence of the string and moves on to the next lookup. How do i make it look for not only the value but the index color?

View 5 Replies View Related

Check Box Change Color When Its Checked

Oct 20, 2008

Is there a way I can make my check box change color when it's checked? I'd like to have it uncolored and then turn green when checked. Not the cell, but the checkbox itself. I can't seem to make the check box part of the cell, if that would be an easier route to go please let me know. If I have to turn the cell green and not the check box, I'd love for the whole row to turn green.

View 3 Replies View Related

Check For Presence Of Cell Color

Jun 17, 2008

I want to create some code that checks all the cells in a row to find if any cell has a background color and if it finds any colored cell, to then set the first column of that row to that color.

View 9 Replies View Related

Check Font Color And Return A True Or False

Nov 24, 2008

I am looking for a formula to return either True/False in Column J if the font color in Column H is Red.

Is there a formula that can do this?

View 8 Replies View Related

Automatically Check Cell Has Value Greater Than Zero & Change Tab Color

Oct 14, 2009

I have these two subs in my thisworkbook module.

They do not want to work together.

Is there a way to incorporate the two of them?
T
he first 1 just checks to see if a cell is greater than 0 and colors the Tab green.

The first 1 is this:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim ShArr As Variant
Dim RunMacro As Boolean
Dim sCounter As Integer

View 3 Replies View Related

Color Column Charts Based On Font Color Data Cells

Oct 27, 2009

I have attached the relevant spreadsheet for which I need to alter the color of the columns based on Site number ( Sheet 1). % Mortality will be represented in the Y-Axis, and the Site numbers would be on the X-Axis. All columns (% Mortality) except one will be of the same color, and the one of a different color will indicate a specific site. As an example, site 86 is colored differently. The way I require the chart to look is shown on Sheet 1.

After reading through some great posts on Ozgrid, I managed to do this using conditional formatting (Sheet 2), but that sort of falls short because I am required to add a data table to the chart, and the parameter that is indicated by the column bars happens to appear twice in the data table.

I was wondering if this can be automated maybe using VBA, but with the possibility of simply matching the color of columns with the font color of respective entry in the data series.

View 9 Replies View Related

Using Check Box To Delete Row

Aug 14, 2009

I'm trying to repurpose this script I found so it deletes the row in an excel spreadsheet when it is checked. The current script just hides them. I'd also like to see ifthere is a way to have the row number automaticaly referenced via the checkboxes cell link so I woudn't have to make a custom macro for each row I want to have he checkbox delete feature.

Here is what I'm trying to repurpose:

Sub HideRows()
If Rows("9").RowHeight = 0 Then
Rows("9").Hidden = False
ActiveSheet.CheckBoxes("Check Box 346").Visible = True
Else
Rows("9").Hidden = True
ActiveSheet.CheckBoxes("Check Box 346").Visible = False
End If
End Sub

View 9 Replies View Related

Color Cells Based On Color Of Preceeding Cell

Nov 18, 2007

I am looking for a very simple script that will achieve the following:

On the clicking of a button, Select and shade in a cell yellow, delete the yellow shading of the previous cell. The shading & selection should move up a column of cells, 1 at a time, in the following order:

From B10 to B9, then B9 to B8, B8 to B7 etc until the selection and shading is at B2. Once it is at B2 subsequent clicks will simply keep it at B2 (the top). Thus after 8 clicks the shading & selection should travel from B10 to B2, with only 1 cell being shaded yellow and selected at any one time.

View 5 Replies View Related

Macro To Color Cells Based On Their Font Color

Jun 18, 2008

I have a spreadsheet that i download from the net daily, which is seperated into columns of information.

I want to be able to look down a column and mark a cell in a seperate column if the cell font text is red.

For example looking down column A ... if the font text of a1 is red then mark the cell background colour of T1 red - if a2 text colour is red then mark the cell T2 red .... etc etc.

If the font colour in a1 or a2 ... etc etc is any other colour then do nothing.

I have 5 columns I wish to look down and mark in 5 seperate columns - I have tried to do this by conditional formating but don't know the fomula for checking font colour.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved