Changing Cell Colour

bubba06

New Member
Joined
May 16, 2006
Messages
13
Hi - I have a drop down box with 3 entries in it - 1. Not Started 2. Work In Progress 3. Completed - if i selected "not started" I want that same cell to change to red with "not started" - Orange for "work in progress" and green for "completed" - and if completed is selected i need to make the next cell come up with date (now)

Thanks in Advance
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Here is some automated code, right click on your tab, select View code:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Dim myDate As Date
Dim Response As String
If Intersect(Range("H:H"), Target) Is Nothing Then Exit Sub
myDate = Format(Now(), "mm/dd/yyyy")

If Target.Value = "Completed" Then
Target.Offset(, 1).Value = myDate

ElseIf Target.Value <> "" And Target.Value <> "Completed" And Target.Offset(, 1).Value <> "" Then
    Response = MsgBox("If did not intend to change the status from ""Completed"", please select ""Cancel"".", vbOKCancel)
        Select Case Response
            Case Is = 1
            Target.Offset(, 1).Value = ""
    Application.EnableEvents = True
            Case Is = 2
            Target.Value = "Completed"
            
        End Select

End If
Application.EnableEvents = True
End Sub

I've based this code on your drop-down in Column H and your completed date in I.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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