Colouring Tabs Based On A Cell Value

Jul 28, 2009

I've been trying to get a macro together which would colour all the tabs in my workbook based on whether or not a certain value exists in a certain cell. In this case the cell is C7 and the word there is "elective class:".

View 7 Replies


Colouring Tabs Dependant On True / False Condition

Feb 21, 2010

I have "borrowed" the below code from a previous solved post, however am unsure how to adapt it.

View 7 Replies View Related

Colouring Cell Based On RGB And Index Numbers

Jan 28, 2014

As you can see from below I already have a spreadsheet which updates the fill colour of cells based on a certain criteria. This was initially set up in Excel 2003....I have now moved onto 2010 and want to use a certain colour based on it's RGB value. I tried as you can see from below, the part which is commented out (as it didn't work)


Private Sub Worksheet_Change(ByVal Target As Range)
Dim n As Long, lngIndex As Long
For n = 6 To 842


View 3 Replies View Related

Colouring Cells Based On Date?

Feb 28, 2014

I am currently using a piece of code (within a bigger piece) that colours the dates in two columns based on how close it is to the current date. It works fine but sometimes the sheet it is looking in has over 3500 rows so it is taking for ever (well over 6 mins)

The code is

HTML Code:

Sub ColDate() 'date case opened
application.ScreenUpdating = False
Dim MyRg As Range
Dim F As Range
Dim DateDiff As Long
Set MyRg = Range("g1:h" & Range("H" & Rows.Count).End(xlUp).Row)
For Each F In MyRg


View 1 Replies View Related

Conditional Formatting - Colouring Percentage Of Multiple Cells Based On Date Range

Mar 12, 2014

I am trying to get a row of cells to highlight a percentage based on a date range

Below is an example of what my spreadsheet will look like, very simple for managers to read and understand but I am stuck on how i can get this to display the right way.

In the example i would need the Jan column to colour for a certain percent for 21 days and continue to feb for 26 days. Im not sure if this makes sense but this is what they are asking for. Colour bars to simple show the percent of days off each month.

Name Start Date End Date Jan Feb Mar

Dale 11/01/14 26/02/14 21 days 26 days

I have attached the spreadsheet for an example : Book1.xlsx‎

View 3 Replies View Related

Cell Colouring In

Aug 7, 2006

Is it possible to get the following to work.

If cell A2 has the number 5 in it (as a result of a calculation in that cell), is it possible to get the next five cells in that cell to colour themselves in?

Obviously, as and when the value in cell A2 changes, i need the number of cells coloured in to change as well.

In addition to this, the rows that this will happen in will vary week to week so i'm not sure if VBA is the way to do this.

Also would there be any problem with negative figures as when that happens i don't want any cells to colour in at all.

View 9 Replies View Related

Reference Cell Colouring

Oct 18, 2011

How do i have colouring to a reference cell what i mean is that on certain formula i get BUY or Sell on that cell. As per the conditional formatting i have made the colour change BLUE FOR "BUY" & RED FOR "SELL"

On second sheet i link the above TEXT., but the COLOUR OF THE TEXT Does not come.

Does CONDITIONAL Formatting come with reference cell.

View 7 Replies View Related

Colouring Cell If It Has A Specific Date

Feb 17, 2010

I have a column for each month where the dates are entered on rows. Is it possible I can color a cell if the date entered in a cell for that month is 15 days past the end of the month. Like, if in a January column I enter a date on one of the rows as Feb.20, then the cell fills with red colour. I tried doing it using conditional formatting, but don't know how to say 15 days past end of the month?

View 5 Replies View Related

Select Tabs Based On Cell Entry

Dec 17, 2008

i'm trying to basically use VBA, so that when a list of work tab names are entered into a column in say Sheet 1..these tabs are then selected.

View 4 Replies View Related

Rename Tabs Based On Information In Cell

Mar 11, 2013

I am looking for a macro to rename tabs based on information in A1 on each tab. The thing that is causing me issues is the cell A1 has a formula in it and it changes on a daily basis with days of the week but the tab only updates when i double click A1 and press enter.

I need it to update automatically.

View 4 Replies View Related

Rename Tabs (Sheets) Based On Cell Contents

Nov 10, 2009

I have 5 sheets. In the first sheet I have set up 4 cells where I want the contents of them to automatically rename the other 4 corresponing sheets.

In Sheet 1, Cell B6, I want the contents (which will be text) to be the name of sheet 2 automatically.

In Sheet 1, Cell B7, I want the contents (which will be text) to be the name of sheet 3 automatically.

View 8 Replies View Related

Create Documents Based On Cell Values And Input Tabs In New Document

Sep 12, 2013

I want to create a macro that creates a new .xlsx document based on cell values. And input 4 tabs into each document with specified tab names. I have a document that pulls from external sources and fluctuates with amount of data per day. I envision something that will make a new document named for the contents in cell A1, then function as a control+down to create a new document for A2, then A3 until there is no content left (should mention these are lookup formulas, and if there is no data it pulls a value of "0")

Is there a way to put in the code, the tab names it would create in each new document, or would that have to look to a cell value for the naming? The tab names would be "GS", "MYSS", "COLL SHEET", and "WIRE".

View 1 Replies View Related

VBA Colouring Cells

Oct 10, 2008

I have a spreadsheet that contains data I import from various sources. Once the import is complete I need to colour various cells based on their contents. Normally I'd use conditional formatting, but there are more than 3 conditions so I need to use VBA (preferrably that i can turn into a macro and assign to a button to click once I've finished the imports each time)

eg: Everytime a cell content is the word "RED" , colour it red - then the same with various other colours.

Google has found me a change event piece of code but it doesnt work when you're cutting and pasting some info.

View 9 Replies View Related

Colouring Non-contiguous Cells With VBA

Dec 4, 2012

I have a rather large database that I'm trying to automate colours in, based on data that is inserted into Column 'D'. I've used the following code (with some success), but it colours columns that I don't want to colour:

Sub KeyCellsChanged()
Dim Cell As Object
For Each Cell In Range("D1:D5000")


That works fine - but the problem I have is that I only want to colour columns A:N, Q, T, V, AB:AE, etc. (random columns and not always together). I have already tried to replace parts (as follows), but get all sorts of errors (in particular Run-time error 1004):

If Cell = "Rabbit" Then
Cell.Range("A:N,Q, T, V, AB:AE").Interior.ColorIndex = 42

Is there someway that a line of code can determin which cells to colour in the row, or alternatively code that will colour the columns a specific colour and make them stay that colour when the first code above is used?

View 3 Replies View Related

Colouring Autoshapes Using Macro

Jan 27, 2009

Just trying to work out the best way to be able to determine autoshape colours using cell values. For example I have 12 shapes that need to coloured either Red, Green or Orange depending on a specific cells value, 1 for Red, 2 for Green and 3 for Orange.

I have sort of managed to successfully complete this for 1 of the shapes, by using the RGB Fill option (Using 3 = Red, 4 = Green and 45 = Orange). But cannot for the life of me work out how to do this for multiple shapes using different cell triggers. Below is the code that I currently have and the spreadsheet that is linked to:

View 5 Replies View Related

Colouring Specific Cells Using VB

Dec 22, 2006

how I might be able to colour certain cells in a row a specific colour when a specific value is input.

For instance:
The value "A" is put into row A1. A1 and C1 cell colours change to green
The value "B" is put into row A2. A2 and C2 cell colours change to orange
etc. (not sure how many colours yet)

I sort of have a script set up, but there are certain things I dont know how to do. Like target the specific cells that need colouring.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 0 Then Exit Sub
Select Case Target.Value
Case "A"
Target.Interior.ColorIndex = 1
Case "B"
Target.Interior.ColorIndex = 2
Case "C"
Target.Interior.ColorIndex = 3
Case Else
Target.Interior.ColorIndex = 0
End Select
End Sub

View 9 Replies View Related

Colouring The Row By Conditional Formatting

Aug 2, 2006

I have a gone through quite a few topics in this forum.....but couldnt find answer to my question....may be because its too basic. I have a worksheet with 10 columns. I am trying fill colour in the rows that have "text" in column J (in other words.....their column J is not blank). I figured out how to fill the colour in the cells in column J when they are empty, but cant figure out how to colour the entire row from A:J.

View 4 Replies View Related

Colouring Many Cells, Depending On The Value Of One

Mar 28, 2007

I'm trying to automatically shade a number of cells dependant on the value in a single cell. ie. If D2="quote" then I want A2:Q2 to be yellow. If D2="Design" then I want A2:Q2 to be green etc etc. I have about 6 options in all of what D2 could be.
I then want to repeat this for about 200 rows.

View 7 Replies View Related

Colouring Lines Of Text In Comments With VBA

Aug 2, 2008

I currently have some code which reads a stock file, adding up the stock for each individual item (which may be in one or more locations in the warehouse) and then placing the total stock count in a cell with the detail (of how much stock is in each location, the location and the expiry date) and a separate line for each location, in a comment.

The comment is constructed one line at a time as the code finds the stock records, see code below:

With shtWorking.Range(strStartColumn & intRow + 2)
oldComment = .Comment.Text
.AddComment oldComment & vbNewLine & strComment
.Comment.Shape.TextFrame.AutoSize = True
End With
All this works very nicely, but I want to colour individual lines depending on the expiry date. This can be done manually in Excel, but I cannot find a way of colouring individual lines of text in a comment using VBA.

So, does anyone know of a way I can colour individual lines of text in a comment, using VBA?

View 9 Replies View Related

Auto Colouring Cells Containing Formulas

Jul 23, 2006

auto colouring cells containing formulas

View 2 Replies View Related

Sum Tabs Based On Criteria

Feb 18, 2010

I need to create the formula in "Sum state" sheet B2 to sum items for tab AZ (b2:b6). The formula needs to work when I drag it down to other cells.
For example if I drag formula to B3 it needs to adjust the tab from AZ to CA, and add things for that tab. Each cell from A2 :A 11 represent a state and each tab has actual info for each state

View 3 Replies View Related

Hide Tabs Based On A Value In Another Tab?

Mar 23, 2009

I have a "master" tab that has a dropdown menu (via a validation list) which will determine what the spreadsheet does. Based on the value selected via this dropdown, I would like to show the relevant tabs and hide the irrelevant tabs. I would prefer for this to happen automatically without a macro.

View 5 Replies View Related

Colouring Cells To Show Academic Achievement

Apr 16, 2006

I'm a teacher and would like to show progress in my pupils achievements by colouring coding cells in excel. For each subject they are given a level, e.g. 2b. If they show progress, they would move up, i.e. to a 2a. The whole progress scale is shown below:


To make the spread sheet visual i would like colour code the cells depending on whether progress has or has not been made. If they go up (e.g. 2b to 2a) i would like the cell to turn green, if they go down (e.g. 2c to 1a) i would like the cell to turn red. If not progress has been made then the cell can stay uncoloured. Each cells colour would only be dependent on the cell directly to the left.

View 7 Replies View Related

How Do You Print Only Certain Tabs Based On A Fields Value

Sep 30, 2008

I was recently posed with the following by our PMO: "Can I, or how do I, print only those tabs that belong to specific PM? I know I can go and select just those tabs collectively and print but I hate sifting through these 40+ tabs to find the ones that belong to PM "X". Can't you just use, or create, a macro or something?"

I replied that this might be limitation of Excel but that I would research it and see.

The project template cell reference is D5, there are 11 tabs containing project info for this PM (out of 43), it is running on XP, and is in Excel 2002.

View 9 Replies View Related

Hide Workbook Tabs Based On Certain Criteria

Jun 10, 2014

I have tabs within my workbook that are pulling from other tabs in the same workbook. There are 30-40 tabs, and only 10-15 are used at a time. Is there a way to hide tabs that are not being used? If I do a calculation in A1 and it's greater than 0, I'd like the tab that is pulling from A1 to be visible. If A1 is 0, then I'd like to hide it.

View 14 Replies View Related

Count Sheet Tabs Based On Color

Jun 12, 2008

I have a worksheet with like lots of color coded tabs and the tabs increase everyday. The tabs are categorized based on 6 colors. I created a first tab in order to give how many tabs i have another each color. Is that doable in excel. Do I need a macro for this.

All I want is each time i open the excel sheet the first tab will be automatically updated with how many tabs I have under each color instead of me counting the tabs.

View 6 Replies View Related

Pulling Rows From Other Tabs In Workbook Based On Date?

Jan 25, 2014

I have a workbook with multiple tabs, each tab is representative of a person and their ongoing project list. What I am trying to do is to be able to pull rows from each tab identifying the persons active projects based on an assigned due date.

Details: Tabs for Tom/Susan/Phil/Jerry each person will be updating their own sheet with project completion details. Each tab has similar headers with a corresponding due date or completion date. On the master sheet I would like to pull those rows that correspond to the specific dates for all persons.

Example - give me all rows that reflect projects due on 1/21/2014.

View 6 Replies View Related

Macro To Create New Tabs Based On A Contract Number

Apr 11, 2008

I work with contracts and have to report the sales for each contract by customer number, name, address, product code or sku, sales amount, quantity, and invoice date. Each contract number is associated with a product group and within that product group are a laundry list of product codes or skus.

Customers are often on different contracts for different products and may purchase some or all of the products on that contract. When I run a query from the system to extract this data, I get one sheet that contains 20,000 lines that have to then be sorted and seperated into different tabs based on the contract number. Keep in mind that a customer may be listed multiple times because each line in the query represents a product code and an invoice date.

I currently have a macro that will format the reporting such that it sorts the data, however, what it doesnt do is look for each instance of a particular contract number and separate it into different tabs.

So below are two examples: April and May 2008 Reports

April 2008 Report
Contract 1 contains 5,000 lines of data - extract into new tab
Contract 2 contains 5,000 lines of data - extract into new tab
Contract 3 contains 5,000 lines of data - extract into new tab
Contract 4 contains 5,000 lines of data - extract into new tab
Total lines = 20,000

May 2008 Report
Contract 1 contains 7,500 lines of data - extract into new tab
Contract 2 contains 5,500 lines of data - extract into new tab
Contract 3 contains 8,000 lines of data - extract into new tab
Contract 4 contains 9,000 lines of data - extract into new tab
Total lines = 30,000

So for the April Example, I would like excel to take this one list and break into 4 new tabs based on the contract number and carry over all of the data into that tab.

Where this may become difficult is that there may be more lines of data one month and fewer another. Im not sure if there is a function that will tell excel to stop when it reaches the last line for one contract number and to start a new tab for the next contract number. (see the month of May example)

View 9 Replies View Related

Order Columns & Tabs Based On User Input

Jan 9, 2009

How would I reorder columns & tabs based on a form where the user can put them into order that they would like the columns? I forsee some type of form where the user can dsignate the order and then start a macro that will sort both the columns and tabs.

View 5 Replies View Related

Excel 2007 :: Change Colour Of Tabs To Match Other Tabs In Workbook

Sep 22, 2012

I have been trying to get Excel (2007) to change the colour of tabs to match other tabs in the workbook

Using this code I get the colour code of the current tab

x = ActiveSheet.Tab.ColorIndex

But when I use this value in a procedure like this:

ActiveSheet.Tab.ColorIndex = x

The tab is a different colour!

View 3 Replies View Related

Copyrights 2005-15, All rights reserved