Highlighting rows by date
Solved/Closed
bryanfarley
Posts
3
Registration date
Wednesday 8 September 2010
Status
Member
Last seen
10 September 2010
-
8 Sep 2010 à 14:52
bryanfarley Posts 3 Registration date Wednesday 8 September 2010 Status Member Last seen 10 September 2010 - 10 Sep 2010 à 10:13
bryanfarley Posts 3 Registration date Wednesday 8 September 2010 Status Member Last seen 10 September 2010 - 10 Sep 2010 à 10:13
Related:
- Highlighting rows by date
- How to delete rows in word - Guide
- Repeat rows in excel - Guide
- Vba insert multiple rows - Guide
- The following excel image has a vba program (see below). what will be the result after the program is executed? any cells not displayed are currently empty, and any cells with numbers are formatted numeric. sub afdo a=0 lastrow = cels(rows. count, 1). end(xdup). row for i =14 to lastrow step 2 a=a cellsii. 5) value next cells(lastrow 2, 1) value = "the sum - Guide
- Excel duplicate rows delete - Guide
2 responses
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
9 Sep 2010 à 21:23
9 Sep 2010 à 21:23
in the first message you talked about only H2 and now it is I3 to I263
I suppose I3 to I263 is correct where the dates are parked.
in this case open vb editor, click control+R. in the project window go to your file and right click "thisworkbook" and park this event code
taking into account basic colors no. 6 is yellow and 3 is red.
I suppose I3 to I263 is correct where the dates are parked.
in this case open vb editor, click control+R. in the project window go to your file and right click "thisworkbook" and park this event code
Private Sub Workbook_Open()
Dim r As Range, c As Range
Worksheets("sheet1").Activate
ActiveSheet.Cells.Interior.ColorIndex = xlNone
Set r = Range("I3:I263")
For Each c In r
If c > CDate(Date) And c <= CDate(Date + 30) Then
c.EntireRow.Cells.Interior.ColorIndex = 6
ElseIf c > Date + 30 Then
c.EntireRow.Cells.Interior.ColorIndex = 3
End If
Next c
End Sub
taking into account basic colors no. 6 is yellow and 3 is red.
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
9 Sep 2010 à 06:31
9 Sep 2010 à 06:31
open vb editor (alt+F11). hit control+R. in the project go to your file name and right click "thisworkbook" and click "view code". In the resulting window copy tis event code
whenever you open the file this event code will be executed.
Private Sub Workbook_Open()
Range("H2").EntireRow.Cells.Interior.ColorIndex = xlNone
If Range("H2") > CDate(Date) And Range("H2") <= CDate(Date) + 30 Then
Range("H2").EntireRow.Cells.Interior.ColorIndex = 6
ElseIf Range("H2") > Date + 30 Then
Range("H2").EntireRow.Cells.Interior.ColorIndex = 3
End If
End Sub
whenever you open the file this event code will be executed.
bryanfarley
Posts
3
Registration date
Wednesday 8 September 2010
Status
Member
Last seen
10 September 2010
9 Sep 2010 à 10:31
9 Sep 2010 à 10:31
OK I cannot seem to get this to work, the range needed is I3 thru I 263 (which I think would be "I3:I263" correct?) and the colors needed are red (24?) for the passed date and yellow(35?) for the month away date. While working on this even using it just the way you have here everything stays clear, I might be just missing a simple step though.
10 Sep 2010 à 10:13