Code To Colour Cells Dependent On Reference To Adjacent Criteria

Jun 11, 2014

I have developed the following code to colour cells dependent on reference to adjacent criteria (in Col D).

Is there anyway I can simplify this code to avoid three separate "For each" statements?

Code:
For Each c In Range("E12", Range("e" & lastrow))
If c = "" And c.Offset(, -1) "" Then
c.Interior.ColorIndex = 7

[Code] ..........

View 2 Replies


ADVERTISEMENT

Conditional Formatting To Change Colour Of Cells Dependent On Text Within Them

Sep 8, 2013

How to colour cells depending on text in other cells, for example,

I would like cells D26:AA26 to turn light red if the letters 'FSM' are in cell 'E26' even if other text appears in it, eg 'SA+/FSM'
I have been playing about with conditional formatting but can seem to solve the mixed text issue?

I have included an example below,

Do you use a "*FSM*" around the formula?

[URL] ...........

View 7 Replies View Related

VBA Code To Colour Certain Cells Based On RGB Colour Shown In Cell A1

Apr 17, 2014

I have a lookup that gives and RGB colour code in Cell A1; for example 186, 206, 140.

I'd then like Cells R10:V15 to fill with the RGB colour based on the result in A1.

View 2 Replies View Related

How To Reference Adjacent Cells

May 23, 2013

I need the syntax that allows me to reference the cell directly beside my target cell for each row in a column

Like:

Col A Col B
S D
T F
S F

If i was targeting Col B

View 6 Replies View Related

Fill Empty Column Cells With Reference To Adjacent Cells

Aug 11, 2008

I would like a macro that when run, finds empty cells in a column within the used range and fills them with the same formula in the other cells in the same column but relative to the row.

I have a basic understanding of VBA so if someone can set me on the right track i'll have a go myself as i appreciate this would take a while to write out from scratch.

View 9 Replies View Related

Use Values In Adjacent Cells In Formulae Reference

Nov 24, 2007

I'm trying to write a function that returns, from a different sheet, the value in column C and row 6*current row.

For example, if the function is typed into cell B5 in Sheet 1,
the resulting value would be whatever is in cell C30 in Sheet 2

I tired the following but it gave me an error
=Sheet2!&"C"&(ROW()*6)

View 2 Replies View Related

Gantt Chart: Color Cells Dependent On Criteria

Dec 5, 2006

I have a list of task owners that are assigned tasks. The tasks are mapped out in Gantt chart form with time shown by an "X".

what I want to do is to colour the cells "X" with the associated cell colour of the task owner and should the owner change, the cell colour changes.

View 5 Replies View Related

Drag Copying Formula Down While Skipping Cells In Adjacent Reference Column?

Feb 2, 2014

I have a spreadsheet with temperature data, all in one column (D), that was recorded every 10 minutes for several months. In two adjacent columns (E & F), I would like to record the daily max and min temperatures. I can manually do this with MAX and MIN formulas in column E and F respectively, MAX(D1:D144). But when I copy this formula to the next row, I get MAX(D2:D145) when what I really want is MAX(D145:D288)....and so on...

View 1 Replies View Related

Colour Any Cells That Meet The Criteria

Apr 6, 2007

I want this macro todo is to start at the top of columns A to J
and work down the column and colour any cells that meet the criteria.

Range(“A1”).Select

Do Until ActiveCell = ""

If ActiveCell > 0 Then

Selection.ActiveCell.Interior.ColorIndex = 5


Else

ActiveCell.Offset(1, 0).Select

End If

Loop

End Sub

View 9 Replies View Related

Merge Adjacent Cells With Criteria

Aug 1, 2012

I need a code or macro which, when applied to a selected column, will merge a range of cells in that column into one cell. The criteria is to merge all cells into one cell that fall directly under the cell which contains "Items - total..." and that lines are separated by a line break (alt+enter).

Here's an example of what the column contains:

Before code:

A1: Items - total: 2
A2: four-legged
A3: cat
A4: two-legged
A5: chicken
A6: Items - total: 1
A7: four-legged
A8: dog
A9: Items - total: 3
A10: four-legged
A11: pig
A12: two-legged
A13: eagle
A14: marine animal
A15: shark

After code:

A1: Items - total: 2
four-legged
cat
two-legged
chicken

[Code] .......

View 1 Replies View Related

Automatically Colour Code Cells

Sep 25, 2009

Is there a way to automatically conditionally format each column in each row, when either open, closed or cancelled is selecting from a drop down in the Status column. For example every cell is blank in colour, but if I select open in the drop down menu for row A2, the entire row will turn Red. Just wondered if there is a way instead of individually formatting every row separately. I would like to be able to copy the formula or whatever down the entire sheet.

View 2 Replies View Related

Change The Colour Of Another Cell Dependent On Dates

Jan 18, 2010

I'm looking for a formula that will change the colour of another cell dependent on dates.

Say I have a date (or any data) in cell A1 I want cell A2 to be highlighted yellow, after 10 days I want this cell to change to red as it is overdue.

Finally when a date is entered into the yellow/red cell I want the colour to remove.

View 9 Replies View Related

Extract Records Where Adjacent Cells Meet 1 Criteria?

Apr 28, 2013

I need to return the values in Column A IF any of the adjacent cells (columns) contain a number.

Sample data and expected Results...

Sheet2  ABCDEFGHIJK1DateData1Data2 Data3Data4 Data5 Result 
201/01/20132       01/01/2013 302/01/201311      02/01/2013 403/01/2013 1      03/01/2013 504/01/2013   
13   04/01/2013 605/01/2013 06/01/2013 706/01/2013    
1   08/01/2013 807/01/2013        11/01/2013 908/01/2013    
1   12/01/2013 1009/01/2013 13/01/2013 1110/01/2013        15/01/2013 1211/01/2013      2   1312/01/2013      
1   1413/01/2013 1 1      1514/01/2013          1615/01/2013   3      17

I cannot use VBA, Advanced Filter or a Helper column, but I could use one additional cell to hold a count, so, the solution can only be a formula.

View 7 Replies View Related

Count Adjacent Cells Meeting Date Criteria

Jun 23, 2008

I want to count no of "yes" in Range Column B only if corresponding values in column A is less than 10/06/2008

Please see the attached file for refrence

View 5 Replies View Related

Formula Dependent On Text In Adjacent Column

Oct 7, 2009

I have a datatable which has a column containing up to 25 different text codes (which are currency pairs). I need to insert a specific number (as seen in the attached example) in a second column. This number depends on the text in the first column. I suspect this is very simple but at the moment, not for me!

View 3 Replies View Related

Comments In Dropdown Box Dependent On Number Selected In Adjacent Cell

Jul 8, 2013

I have been asked by my supervisor to make a performance review template a little bit more user friendly.

Basically what I have is a drop own list in cells in one column (various cells with the same drop down menu) that you select from either 0-10 in a drop down box.

I have another cell which I want to have a drop down box with text comments that you select from when. Only problem is the comments different dependent on the ranking score you give a person (the number selection in the previously mentioned cell from 0-10). So if you have a score between 9-10 in the cell then the comments box will give you certain comments to choose, 7-8 different comments and so on and so forth.

View 1 Replies View Related

VBA Code - Changing Formatting Of Adjacent Cells At Varying Places

Jul 31, 2012

I have a macro that, at varying places, changes the formatting of adjacent cells. The formatting code is easy to generate via the macro recorder, but it's long - longer than the macro itself - and I'm using it a couple of times (due to if statements). That makes it difficult to read. It's usable, but looks ugly. I'd like to streamline its appearance.

Is there a way to do something like:

Code:
If range("F5").Value > 0 then
Activecell.Offset(1,0) format = blah
ElseIf Range("F5").Value = 0 then
Activecell.Offset(-1,0) format = blah
End If

The formatting I want is dark gray interior with a border box around it. The macro recorder generated this:

Code:
Sub test2()
'
' test2 Macro
'
'
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1

[Code] ............

View 3 Replies View Related

VBA Code To Change Font Colour Of Cell Referenced Letter Strings Within Range Of Cells

Jun 13, 2014

I am working on a spreadsheet for work, and have managed to do everything I need to so far but I need to colour specific letter strings, certain colours within a range of cells (each letter string will only appear once on each sheet)

The strings I will be looking for vary depending on data entered so I will need to cell reference them

The strings that need colouring are in cells with other strings that must stay black (They cannot be separated from other strings due to the nature of the grid)

I need some strings red, some green, and some blue.

These changes should also apply to the whole workbook not just one sheet.

Is there a way to do this with the VBA code.

View 3 Replies View Related

Search Excel For Cells With Numbers Of Certain Colour And Changing Said Colour

Feb 13, 2014

Is it possible to search Excel by cell colour, i.e. font colour...and then change the said colour to another one?

View 3 Replies View Related

Use Code To Reference Variety Of Other Cells

Jan 6, 2014

I am building a spreadsheet that references 'LHA rent rates' listed in other cells.

Example table
Bed rate Code: LHA per week:
0 - £55.00
1 - £91.85
2 - £109.61

(Ie two columns with six cells. The first number before the dash are in a separate column. Each of these £ amounts will be in a separate cell.)

In another part of the sheet, i want to be able to type '0' in Cell 1, and this will trigger a formula in Cell 2 to retrieve the correct £ amount i.e., £55.00 in the 'example table' above. Likewise if i change Cell 1 to '2', then Cell 2 automatically updates to £109.61.

I think this would be a long IF formula in Cell 2, but how to do it.

View 3 Replies View Related

Modifying Code To Reference Cells And Its Formatting?

Aug 7, 2012

I am attempting to modify the code below to, not only reference the ".Item(rCell.Value)", but also include it's formatting. The format for that referenced cell will not necessarily be a "certain" format..so I don't want to have to write out what specific formatting needs to happen.

VB:
If (.exists(Trim(rCell.Value)) And rCell.Offset(, 1).Value = "") Then rCell.Offset(, 1) = .Item(rCell.Value)

The entire code is as follows:


VB:
Sub FillVariablesOnlyBlanks()
Application.ScreenUpdating = False
Dim a, i As Long, rCell As Range, ws As Worksheet[code]....

View 9 Replies View Related

Excel 2010 :: Columns That Are Dependent On Each Other Without Circular Reference?

Aug 7, 2014

I have two columns of data; one is in inches, one is in metres. If someone is inputting data from an original source that has the data in metres I want excel to automatically calculate and input the data into the inches column. Additionally, if they input the data from the source in inches, I want excel to convert it to metres and input into the other column automatically. The conversion factor from inches to metres is * by 0.0254. I am no expert but after looking for this on the internet I am sure this requires some sort of VBA event code (although I don't really know the first thing about VBA). The excel columns will be in the same worksheet. I don't have a circular reference like I would do using normal Excel formula? I am using Excel 2010.

View 2 Replies View Related

Copy Non-adjacent Cells In A Row From One Spreadsheet To Adjacent Rows In Another

Jan 5, 2014

I have a workbook with 30 worksheets. Each sheet has 84 rows of data (start in 15 columns (A to O). I would like to create a summary sheet that only shows the most important data from each sheet.

The summary sheet would have 12 lines of headers and formatted crap at the top.
The Summary sheet header columns would be:

Site (A), Date (B) Health (C), Status (D), Critical (E), Task (F),
Dependencies (G), Owner (H), T-Date (I), Task Date (J), Mitigation Date (I)

The data in the sheets are not in that order, of course.

That
1. puts the name of the sheet I am copying from in column A
2. the deadline date in Column B (that date is always in C10 of each worksheet)
3. and copies Cells from Column A,B,G,H,I,O in any row in which the value in A is not "good" into columns C through H. I would like to paste those rows into the summary sheet. I have code that loops through the sheets and rows in each sheet to find the rows to copy. I can copy cell values directly from the active sheet to the summary sheet, but because I am copying a cell at a time, it takes 7 minutes. Yes I am impatient :)

Here is the code snippet where the copying is done:

Dim sh As Worksheet 'current worksheet
Dim DestSh As Worksheet 'worksheet in which to paste summary
Dim Last As Long
Dim CopyRow As Long 'row to copy
Dim LastCopyRow As Long

[Code] ........

ExitTheSub:

Application.Goto Sheets("KMARollup").Cells(1)
End Sub

I think there must be a way to use ranges to build an array of cell values and paste only once but I am lost here.

View 2 Replies View Related

Convert Cells Reference To Range Address Code

Sep 7, 2006

I have to convert a range reference in the form of

Range(Cells(1,1),Cells(2,2))

to a reference in the form of

"A1:B2"

View 5 Replies View Related

Changeing A Cells Colour Basing On Other Cells Colour

Mar 23, 2009

i want a cell to change to the colour green if 5 other cells on the page are green colour.

I want a cell to change colour to red if there are 1 or more red cells on the page.

How do I make this work?

View 8 Replies View Related

Sum Values Only If Adjacent Criteria Has Already Met Another Criteria On Another Sheet

Apr 5, 2014

What I would like to do is return the total qty of items on the 'QUOTATION' tab that are upholstery and this having been determined by whether there is a Y (for Yes) or N (for No) against the equivalent item in the 'BASIC_LIST' tab.

So in the below example, the total of Upholstered items would be 182 as items 'ST-11' to 'ST-13A - Tray' do not have a 'Y' against the matching item references in the 'BASIC_LIST' tab.

I would like this Y/N column to be the determining factor as opposed to any other criteria or filtering. (Also the Items column in the 'QUOTATION' tab is only ordered in the way it is for ease of view for this query!)

Picture 2.png Picture 3.png

SUM VALUES OF ITEMS THAT HAVE ALREADY MATCHED ANOTHER CRITERIA.xlsx

View 4 Replies View Related

Reference Cell Colour In Formula

Apr 8, 2008

Is it possible to use the colour of a cell in a SUMIF formula? i.e On the worksheet differnt entries are colour coded depending on what they relate to. If I only want to add all the cells that are Blue can it be done?

View 9 Replies View Related

Reference In Adjacent Column Returned

Mar 4, 2006

I have two columns with multiple sets of data, based on the entered value I
need the corresponding header returned.

For example:
Column A Column B
Apples Green
Red
Granny Smith
Mutsu
Red Delicious

Oranges Naval
Manderin
Clementine
Tangerine

Now based on a response in another sheet I need to return either "Apple" or
"Orange".

=INDEX('Fruit'!A1:A65535,MATCH(K50,'Fruit'!B:B65535,0)) will work if I copy

Apple next to each apple type, but for other items the list of options can
grow dramatically.

View 9 Replies View Related

Colour 7 Cells In A Row And Then Switch Colour?

Jul 17, 2014

So I have a macro that colors the selected cells in a certain color. Now im looking for a code that will switch that color every 7th cell, the cells will only be selected horizontally. For example:

if the selected range is 10 cells, 7 of them should be in one color and 3 of the should be in another. But if the selected range is 15 cells the first 7 should have one color and the next 7 should have another and then the last one should have the first color again, and so on..

View 6 Replies View Related

Change Colour And Values Of Cell Based On The Value In Adjacent Cell?

Nov 10, 2012

I need to write a condition in such a way that cell IF A1= "DBR","BPR","SLR","SKR" then change cell B1 to SPECIFIC COLOUR Each condition different colour. A1 values ("DBR","BPR","SLR","SKR") is a list of selectable values. if the condition is falls then B1 should be normal (white color cell) with 0 in it.

View 1 Replies View Related







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