G
Guest
Hi,
I'm trying to make a code that alerts me when a cell is equal to today's
date. The message spits out the value of a cell that is adjacent to the
active cell but the code isn't working. Could someone please loot at it and
tell me where I went wrong?
Here's the Code:::
Private Sub Workbook_Open()
Dim Ws As Worksheets
Dim sRange As Range
Dim nDate As Date
Dim RowId As Integer
Dim lItem As Integer
Ws = Worksheets("Slabber Reports")
sRange = Ws("N8:N5000")
nDate = Today()
RowId = ActiveCell.Row
For Each Item In sRange
If sRange = nDate Then
lItem = Range("B & RowId & ").FormulaR1C1
MsgBox "Line Item " & lItem & " Is Now Active. Please Perform The Appropiate
Actions To Reflect This Activity", vbOKOnly
Next
Wend
MsgBox "That's All For Today", vbOKOnly
End If
End Sub
Thanks Very Much In Advance!!!
Rob
I'm trying to make a code that alerts me when a cell is equal to today's
date. The message spits out the value of a cell that is adjacent to the
active cell but the code isn't working. Could someone please loot at it and
tell me where I went wrong?
Here's the Code:::
Private Sub Workbook_Open()
Dim Ws As Worksheets
Dim sRange As Range
Dim nDate As Date
Dim RowId As Integer
Dim lItem As Integer
Ws = Worksheets("Slabber Reports")
sRange = Ws("N8:N5000")
nDate = Today()
RowId = ActiveCell.Row
For Each Item In sRange
If sRange = nDate Then
lItem = Range("B & RowId & ").FormulaR1C1
MsgBox "Line Item " & lItem & " Is Now Active. Please Perform The Appropiate
Actions To Reflect This Activity", vbOKOnly
Next
Wend
MsgBox "That's All For Today", vbOKOnly
End If
End Sub
Thanks Very Much In Advance!!!
Rob