I
Idgarad
The following is my attempt to color even days 1 color and odd days
another color.
Sub Hilite()
Dim lngRow As Long
Application.ScreenUpdating = False
For Each wks In Worksheets
lngRow = wks.Range("A2").End(xlDown).Row
Do While lngRow > 0
If Not IsEmpty(tempDay) Then
tempDay = Day(Cells(lngRow, 1).Value)
If tempDay Mod 2 = 0 Then
wks.Rows(lngRow).Interior.ColorIndex = 37
Else
wks.Rows(lngRow).Interior.ColorIndex = 36
End If
End If
lngRow = lngRow - 1
Loop
Next
Application.ScreenUpdating = True
End Sub
The problem is it works but applies the formatting to only the first
tab. What am I missing here?
Sample data below copied across 7 worksheets:
-sdfgsdfg 6/17/2007 19:43:22 6/17/2007 19:45:25
sdfgsdfg 6/17/2007 22:07:45 6/17/2007 22:08:19
fghjfgj 6/17/2007 22:15:04 6/17/2007 22:15:25
rtuyru 6/18/2007 4:00:09 6/18/2007 4:12:37
ryjyr 6/18/2007 4:31:51 6/18/2007 4:43:49
vbngh 6/18/2007 19:00:44 6/18/2007 19:01:16
vhnvhn 6/18/2007 19:07:37 6/18/2007 19:07:57
vmhvmv 6/19/2007 4:00:06 6/19/2007 4:13:02
dhgdtr 6/19/2007 4:33:16 6/19/2007 4:45:13
nmfyy 6/19/2007 19:01:09 6/19/2007 19:01:45
dthdth 6/19/2007 19:09:11 6/19/2007 19:09:32
dthdg 6/20/2007 4:00:07 6/20/2007 4:13:35
cvhncnb 6/20/2007 4:38:32 6/20/2007 4:50:31
cnccg 6/20/2007 19:00:56 6/20/2007 19:01:49
cgnct 6/20/2007 19:09:44 6/20/2007 19:10:05
cntctnctn 6/21/2007 4:00:11 6/21/2007 4:16:25
cntctnct 6/21/2007 4:44:37 6/21/2007 4:56:37
5yd5hh 6/21/2007 19:00:56 6/21/2007 19:01:44
d5hdg 6/21/2007 19:11:37 6/21/2007 19:11:58
dngdnd 6/22/2007 4:00:11 6/22/2007 4:14:19
cngcn 6/22/2007 4:57:18 6/22/2007 5:09:22
ccgncg 6/22/2007 19:00:52 6/22/2007 19:01:29
dth5 6/22/2007 19:08:21 6/22/2007 19:08:41
dh5dhd 6/23/2007 21:00:06 6/23/2007 21:12:18
another color.
Sub Hilite()
Dim lngRow As Long
Application.ScreenUpdating = False
For Each wks In Worksheets
lngRow = wks.Range("A2").End(xlDown).Row
Do While lngRow > 0
If Not IsEmpty(tempDay) Then
tempDay = Day(Cells(lngRow, 1).Value)
If tempDay Mod 2 = 0 Then
wks.Rows(lngRow).Interior.ColorIndex = 37
Else
wks.Rows(lngRow).Interior.ColorIndex = 36
End If
End If
lngRow = lngRow - 1
Loop
Next
Application.ScreenUpdating = True
End Sub
The problem is it works but applies the formatting to only the first
tab. What am I missing here?
Sample data below copied across 7 worksheets:
-sdfgsdfg 6/17/2007 19:43:22 6/17/2007 19:45:25
sdfgsdfg 6/17/2007 22:07:45 6/17/2007 22:08:19
fghjfgj 6/17/2007 22:15:04 6/17/2007 22:15:25
rtuyru 6/18/2007 4:00:09 6/18/2007 4:12:37
ryjyr 6/18/2007 4:31:51 6/18/2007 4:43:49
vbngh 6/18/2007 19:00:44 6/18/2007 19:01:16
vhnvhn 6/18/2007 19:07:37 6/18/2007 19:07:57
vmhvmv 6/19/2007 4:00:06 6/19/2007 4:13:02
dhgdtr 6/19/2007 4:33:16 6/19/2007 4:45:13
nmfyy 6/19/2007 19:01:09 6/19/2007 19:01:45
dthdth 6/19/2007 19:09:11 6/19/2007 19:09:32
dthdg 6/20/2007 4:00:07 6/20/2007 4:13:35
cvhncnb 6/20/2007 4:38:32 6/20/2007 4:50:31
cnccg 6/20/2007 19:00:56 6/20/2007 19:01:49
cgnct 6/20/2007 19:09:44 6/20/2007 19:10:05
cntctnctn 6/21/2007 4:00:11 6/21/2007 4:16:25
cntctnct 6/21/2007 4:44:37 6/21/2007 4:56:37
5yd5hh 6/21/2007 19:00:56 6/21/2007 19:01:44
d5hdg 6/21/2007 19:11:37 6/21/2007 19:11:58
dngdnd 6/22/2007 4:00:11 6/22/2007 4:14:19
cngcn 6/22/2007 4:57:18 6/22/2007 5:09:22
ccgncg 6/22/2007 19:00:52 6/22/2007 19:01:29
dth5 6/22/2007 19:08:21 6/22/2007 19:08:41
dh5dhd 6/23/2007 21:00:06 6/23/2007 21:12:18