Message Box working with dynamic data

L

Legacy 76526

Guest
Hi All,

I have searched the boards (message box, dynamic data, stock market, dialog boxes) and internet but have not found out how I can solve my problem.

I have an excel spreadsheet (Excel 2002) using Windows XP home and the spreadsheet has DDE links to import dynamic data from the stock exchange. The spreadsheet works fine except for the ability to alert me to possible and immediate buy opportunities. Currently I have a colour change to signal these opportunities, but would prefer a message box popping up instead to make more efficient use of my time.

When the buy condition is met, I would like a message box, preferably in a new window which I can minimise to the taskbar, to tell me which stock code (eg XYZ) has reached the condition. If it also pops up with a simple "boing" sound, then this is a bonus. I would like a simple 'OK' button to close the window.

I have 200 stock codes in excel in column A2 to A201, with my target buy price for each stock correspondingly in column J and the Asking price (dynamic) for each correspondingly in column H.

Because of the use of dynamic data, the message box must not fire perpetually once the true condition is met. In an attempt to get around this problem I have been thinking of using a drop down menu in column T with choice of "" (blank) or "fired" ("fired" is stored in cell $v$4). Thus when the buy condition is met, the program MUST also check if column T cell is blank; if it is then it fires the pop up box and THEN changes T cell to say "fired" (ie copies cell $v$4) to prevent perpetual firing. I hope thats possible! If the buy condition is no longer valid (ie the price drops in value) I want to manually change the value of T cell back to blank (which is currently what i do now)

Here is a summary of my desired features:

1. It will display the stock code of the company (recalling column A value)
2. It will not override other message boxes already displayed (ie a separate box for each message)
3. It will not perpetually fire whilst the true condition is met.
4. Excel will be using dynamically changing data and thus the macro must be able to tolerate DDE links.
5. It will have a simple ‘OK’ button that will make the message box disappear.
6. Firing with a sound is desirable, but not critical.
7. Message box to be in its own window and must be minimisable to the taskbar.
8. Message boxes are dynamic, thus do not need to queue for fired one to be attended to before firing the next.


I have a book on VBA macros and can struggle with understanding the coding language but it takes me a bit of time. I am no idiot with Excel but have had nil to do with writing macros or VBA.

Would appreciate full coding. :cool:
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
You need to build a UserForm then set its Modal property to False that will let you continue without closing or working with the box first. Then use a Sheet or Thisworkbook event to call the UserForm with the Show command.
 
Upvote 0
Thanks fo your quick reply Joe, but unfortunately I have no idea what you mean. I do not know what a Userform is nor a Modal Property.

Do you have examples you can link me to to see what you mean.

Cheers

Brad
 
Upvote 0
UserForms are graphic and require you to build the one you want using the ToolBox controls. The code needed is the code to activate the UserForm and is only one line. UserForm1.Show this can be attached to a hot-key like: Ctrl+f or a Button or an Event.

Hit Alt-F11
ToolBar: Insert - UserForm
Activate the Properties Window in the editor, hover the Icons.
Drag and re-size controls as needed.
 
Upvote 0
OK Joe,

Have created a Userform text box. I think I see what you are getting at, but how do I get excel to call the box?

I need the full coding. As I mentioned previously, I have had no experience with VBA.

Cheers,

Brad
 
Upvote 0
First you need to provide more information what is it that you want to look at that can be used as a trigger. What will be the Event, Condition or Value that can be tested for that you want to display the UserForm?

Then this can be used to call the Sub that will display that UserForm.
 
Upvote 0
Hi joe,

The Excel 2002 code that I currently have that causes a change in colour of the cell by way of conditional formatting is

=AND(J2>D2, J2>= M2, T2="")

This same coding is exactly what I need to have occuring for the message box to trigger for all stocks in rows 2 to 201.

(Just for completeness:
J > D : means asking price is greater than open price
J >= M : means asking price is greater than or equal to target price
T = "" : means stock not yet purchased.)

Thanks for your help.

Brad
 
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

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