Popup message

sjoerdieman

New Member
Joined
Jan 13, 2014
Messages
18
Hi guys,

I'm making a plan which includes some dates

First row: Last date of inspection ( manual editing )
Second row: Next date of inspection ( adds 28 days to the first row )
Third row: days until next inspection ( second row min the date of today )

I want excel to give a popup message when i start up this excel file when the third row reach 5 days.

So if there are 5 days before the next inspection i want to give excel a popup message like: 5 days until inspection. or something like that. I've already found some VBA codes for giving a popup message on the moment you change the value of a cell, but i want to popup at the start of the excel file.

Sorry for my english, but I hope you can help me!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi sjoerdieman,

I've created a quick sample for you with set dates so you can see it working.

Excel Workbook
ABCDE
1Days Until Next InspectionCurrent Date5
218/01/201413/01/2014
Sheet1


You then need to locate the excel object 'ThisWorkbook' in the VBA code window and place the following code in it:

Private Sub Workbook_Open()


If Range("E1") = 5 Then MsgBox "Five days to next inspection", vbInformation, "Next Inspection"


End Sub

Hopefully this will give you an idea on how to set it up.

Regards,

AP
 
Upvote 0
Hi sjoerdieman,

I've created a quick sample for you with set dates so you can see it working.

Sheet1

*ABCDE
Days Until Next Inspection*Current Date*
***

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:181px;"><col style="width:22px;"><col style="width:80px;"><col style="width:64px;"><col style="width:71px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="align: right"]5[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: right"]18/01/2014[/TD]

[TD="align: right"]13/01/2014[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
E1=A2-C2

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

You then need to locate the excel object 'ThisWorkbook' in the VBA code window and place the following code in it:

Private Sub Workbook_Open()


If Range("E1") = 5 Then MsgBox "Five days to next inspection", vbInformation, "Next Inspection"


End Sub

Hopefully this will give you an idea on how to set it up.

Regards,

AP

Thanks for your respone i'll give it a try tomorrow at my internship
 
Upvote 0
Its working, but i want it a little bit different.
Now it keeps popping up when ever i click in excel. I just want to pop it up once at the startup of the file.
 
Upvote 0
Make sure that the code is in the Workbook open event.

This will run only once when the workbook is opened (assuming macros have been enabled) or when macros are allowed.

It sounds to me like you have your code in the Worksheet change or click or calculate event
 
Upvote 0
Its working, but i want it a little bit different.
Now it keeps popping up when ever i click in excel. I just want to pop it up once at the startup of the file.

From what you describe I think Stiuart_W is correct. Can you check there is no other code entered in the sheet you are working on, for example if you are working on sheet1, make sure there is nothing in the following code section:

Private Sub Worksheet_Change(ByVal Target As Range)


End Sub

AP
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top