Check a value every time excel is loaded

S

Subodh

I will get an example to demonstrate my problem.
I have worksheet with data in range A1 to A100 and B1 to B100
Lets say it shows the todays date in A1 to A100 and due date for
paying bill in range B1 to B100 for grocery, phone etc.
If the due date is today (ie A1 = B1) then the excel should
show a message. But, I would like to do that without opening the excel
file.
The problem is to check the values in those cells each time
excel loads (preferably by loading an Addin) and then display a
message if the specified criteria is met.
Thanks in advance.
 
Joined
Jul 19, 2011
Messages
20
Reaction score
0
Just keep the file hidden - though you will need to unhide it to enter new values. Store it in your default XLStart folder so that it is opened, or save it as an add-in and install it.
You can use the workbook open event - put you don't need today's date in column A, though you could put some identifying string in column A, with the due date in column B. Copy the code into the ThisWorkbook object's codemodule.

Bernie

Private Sub Workbook_Open()
Dim i As Long
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If Date = Cells(i, 2).Value Then
MsgBox "Pay the bill: " & Cells(i, 1).Value
End If
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top