Thread: Today only
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Today only

I don't believe this will work on the first of any month... such a cell
would be located at the top of a column and the previous colored cell would
be located at the bottom of the previous column.

--
Rick (MVP - Excel)


"Don Guillett" wrote in message
...
try this untested idea

Private Sub Workbook_Open()
c = Month(Date)
r = Day(Date)

with Sheets("Sheet1").Range("A1")
.Offset(r-1, c).Interior.ColorIndex = 0
.Offset(r1, c).Interior.ColorIndex = 46
end with
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"GIDRA" wrote in message
...
I have a code that when I open the file marks the date in a calendar by a
highlighted cell (coloured). The problem is that when the day after I
open
the file again I find that yesterday's date cell is still highlighted,
include today's date cell.
I want that the code only shows today's date cell.
Is there is a way to solve this?

I am using this code:

Private Sub Workbook_Open()
c = Month(Date)
r = Day(Date)
Sheets("Sheet1").Range("A1").Offset(r, c).Activate
ActiveCell.Interior.ColorIndex = 46
End Sub

Thanks