Automatic Font Colour.

jgmckee

New Member
Joined
Jul 31, 2005
Messages
17
Hi All,

Hoping someone can show me the light.

In the workbook I have, the cell colour of the columns and rows is white.

I have a cell on the far right of these columns which will be used for entering a date.

Is there any way that when the date is entered into this cell I can then have excel automatically change the cell colour for a given number of cells in the row to blue? (including the date cell).

I want to use this a a quick look for people to see which entries in the workbook have been complete.

Thanks

Jason.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
jgmckee said:
Hi All,

Hoping someone can show me the light.

In the workbook I have, the cell colour of the columns and rows is white.

I have a cell on the far right of these columns which will be used for entering a date.

Is there any way that when the date is entered into this cell I can then have excel automatically change the cell colour for a given number of cells in the row to blue? (including the date cell).

I want to use this a a quick look for people to see which entries in the workbook have been complete.

Thanks

Jason.

You can use Conditional Formatting and Formula Is. Highlight the cells and use =ISNUMBER($A$1)
 
Upvote 0
I used a Worksheet_Change() event for this. It'll look in Column G, and check if it's a date. If it is, color the cells from Column B to D with a blue background.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column <> 7 Then Exit Sub
    Application.EnableEvents = False
    If IsDate(Target.Value) Then Target.Offset(, -5).Resize(, 3).Interior.ColorIndex = 33
    Application.EnableEvents = True
End Sub

This goes in your particular sheet's code module. The Target.Column <> 7 checks for Column G. If it's a date, it moves to the left 5 columns (-5), and uses 3 columns (Resize(,3)) and colors them blue (33).

Post back if you have any problems getting this to work. Hope that helps!

How to use the above code:

  • Press Alt-F11 to open the VBE.
    Press Control-R to open the Project Explorer. (May be open already)
    Click "Microsoft Excel Objects" for the file you're working on (should expand the list of the ThisWorkbook module and any sheet modules.)

    Select Insert, Module from the drop down menus for standard modules.
    For ThisWorkbook and sheet modules:
    Double-click the ThisWorkbook module or the sheet this code applies to.
    Select Workbook, Before Close, and Open from the dropdowns.

    Put your code in the right-hand window.
    Press Alt-Q to close the VBE and return to Excel.
 
Upvote 0

Forum statistics

Threads
1,211,839
Messages
6,104,295
Members
447,901
Latest member
boy3hc2004

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top