Condtional Alert/Popup

M

MIKJ6

I have and excel sheet linked to live commodity prices. Is it possible to
have a window pop up over my other windows or have excel maximize
automatically if the price reaches a certain level?

Thank you in advance.
 
M

Michelle

Perhaps you can write a sub that activates your worksheet once the threshold
is met, and you can use a timer to keep re-running the sub until the price
you are looking for appears. This site shows you how set up a timer sub...
http://www.cpearson.com/excel/OnTime.aspx

I was thinking something like...
Say the cell that has the price that you want to monitor is A1, the
threshold price you want is in B1, and the worksheet name that you want
activated once the threshold is met is in C1. To get the sheet name in C1
(assuming this cell is in the worksheet you would like activated once you
have success) you would need the formula
=MID(CELL("filename",C1),FIND("]",CELL("filename",C1))+1,255)
This way if the sheet name changes you will still be able to activate that
worksheet. If that's overkill for you replace
ThisWorkbook.Worksheets(sheetName).Activate
with
ThisWorkbook.Activate


Sub priceCheck()
Dim flag As Boolean
Dim sheetName As String
flag = true
sheetName = Range("C1")
If Range ("A1") = Range("B1") Then
ThisWorkbook.Worksheets(sheetName).Activate
flag = false
End If
If flag Then
Call StartTimer()
'you would set up StartTimer based on the above website
End If
End Sub

I haven't tried running this, but hopefully this gets you on the right path.
Good luck.
 

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