Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh wise ones,
Is it possible to display the value of a cell in the Excel title bar or the system tray. You can see what I'm getting at, monitoring the value of a cell while excel is minimized. This value is constantly changing every 2 seconds from a sheet calculation macro, so the Title/Tray would have to change dynamically. Mike |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It should be easy to update Excel's title bar. Just right click your
worksheet's tab and pick View Code. Then paste this in: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Target.Value End Sub -- Jim "Mike K" wrote in message ... Oh wise ones, Is it possible to display the value of a cell in the Excel title bar or the system tray. You can see what I'm getting at, monitoring the value of a cell while excel is minimized. This value is constantly changing every 2 seconds from a sheet calculation macro, so the Title/Tray would have to change dynamically. Mike |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
I was afraid of this. I works if I manually change the value in the active cell, but this cell changes based on a sheet recalculation, not a change event. The intial value is displayed and remains static. Any other sugestions that may work with a worksheet calculation event? This value is the speed of a manufacturing line pulled from the sql server every 2 seconds, so it's basically realtime. Thanks, Mike "Jim Rech" wrote: It should be easy to update Excel's title bar. Just right click your worksheet's tab and pick View Code. Then paste this in: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Target.Value End Sub -- Jim "Mike K" wrote in message ... Oh wise ones, Is it possible to display the value of a cell in the Excel title bar or the system tray. You can see what I'm getting at, monitoring the value of a cell while excel is minimized. This value is constantly changing every 2 seconds from a sheet calculation macro, so the Title/Tray would have to change dynamically. Mike |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about using the on time event in a recursive call...
Sub RefreshTitle() MsgBox "Tada" application.caption = Sheets("Sheet1").Range("A1").value Application.OnTime Now + TimeValue("00:00:02"), "RefreshTitle" End Sub -- HTH... Jim Thomlinson "Mike K" wrote: Jim, I was afraid of this. I works if I manually change the value in the active cell, but this cell changes based on a sheet recalculation, not a change event. The intial value is displayed and remains static. Any other sugestions that may work with a worksheet calculation event? This value is the speed of a manufacturing line pulled from the sql server every 2 seconds, so it's basically realtime. Thanks, Mike "Jim Rech" wrote: It should be easy to update Excel's title bar. Just right click your worksheet's tab and pick View Code. Then paste this in: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Target.Value End Sub -- Jim "Mike K" wrote in message ... Oh wise ones, Is it possible to display the value of a cell in the Excel title bar or the system tray. You can see what I'm getting at, monitoring the value of a cell while excel is minimized. This value is constantly changing every 2 seconds from a sheet calculation macro, so the Title/Tray would have to change dynamically. Mike |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim T,
It doesn't work at all. I can't even get it to update manually. Is it still due to the calculated vs change event? I'm not that strong in VBA but I do know this sheet has given me fits in other areas due to the calculate function. Thanks a bunch, Mike "Jim Thomlinson" wrote: How about using the on time event in a recursive call... Sub RefreshTitle() MsgBox "Tada" application.caption = Sheets("Sheet1").Range("A1").value Application.OnTime Now + TimeValue("00:00:02"), "RefreshTitle" End Sub -- HTH... Jim Thomlinson "Mike K" wrote: Jim, I was afraid of this. I works if I manually change the value in the active cell, but this cell changes based on a sheet recalculation, not a change event. The intial value is displayed and remains static. Any other sugestions that may work with a worksheet calculation event? This value is the speed of a manufacturing line pulled from the sql server every 2 seconds, so it's basically realtime. Thanks, Mike "Jim Rech" wrote: It should be easy to update Excel's title bar. Just right click your worksheet's tab and pick View Code. Then paste this in: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Target.Value End Sub -- Jim "Mike K" wrote in message ... Oh wise ones, Is it possible to display the value of a cell in the Excel title bar or the system tray. You can see what I'm getting at, monitoring the value of a cell while excel is minimized. This value is constantly changing every 2 seconds from a sheet calculation macro, so the Title/Tray would have to change dynamically. Mike |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Time is it's own thing. You do not want to have it in the on calculate or
on change or any other event. What that function I gave you does is it Posts a message box (Just to prove it is working.) Changes the application caption Sets up to call itself again in two seconds. This code must be placed in a standard module and not in a sheet or in thisworkbook. -- HTH... Jim Thomlinson "Mike K" wrote: Jim T, It doesn't work at all. I can't even get it to update manually. Is it still due to the calculated vs change event? I'm not that strong in VBA but I do know this sheet has given me fits in other areas due to the calculate function. Thanks a bunch, Mike "Jim Thomlinson" wrote: How about using the on time event in a recursive call... Sub RefreshTitle() MsgBox "Tada" application.caption = Sheets("Sheet1").Range("A1").value Application.OnTime Now + TimeValue("00:00:02"), "RefreshTitle" End Sub -- HTH... Jim Thomlinson "Mike K" wrote: Jim, I was afraid of this. I works if I manually change the value in the active cell, but this cell changes based on a sheet recalculation, not a change event. The intial value is displayed and remains static. Any other sugestions that may work with a worksheet calculation event? This value is the speed of a manufacturing line pulled from the sql server every 2 seconds, so it's basically realtime. Thanks, Mike "Jim Rech" wrote: It should be easy to update Excel's title bar. Just right click your worksheet's tab and pick View Code. Then paste this in: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Target.Value End Sub -- Jim "Mike K" wrote in message ... Oh wise ones, Is it possible to display the value of a cell in the Excel title bar or the system tray. You can see what I'm getting at, monitoring the value of a cell while excel is minimized. This value is constantly changing every 2 seconds from a sheet calculation macro, so the Title/Tray would have to change dynamically. Mike |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Global variables persist for the duration as do static varaibles. I think you
are familiar with globals so try this code and run it twice... Sub test() Static x As Integer MsgBox x x = 10 MsgBox x End Sub the first msgbox is a zero and the rest of the time they will be 10. -- HTH... Jim Thomlinson "Mike K" wrote: Jim T, It doesn't work at all. I can't even get it to update manually. Is it still due to the calculated vs change event? I'm not that strong in VBA but I do know this sheet has given me fits in other areas due to the calculate function. Thanks a bunch, Mike "Jim Thomlinson" wrote: How about using the on time event in a recursive call... Sub RefreshTitle() MsgBox "Tada" application.caption = Sheets("Sheet1").Range("A1").value Application.OnTime Now + TimeValue("00:00:02"), "RefreshTitle" End Sub -- HTH... Jim Thomlinson "Mike K" wrote: Jim, I was afraid of this. I works if I manually change the value in the active cell, but this cell changes based on a sheet recalculation, not a change event. The intial value is displayed and remains static. Any other sugestions that may work with a worksheet calculation event? This value is the speed of a manufacturing line pulled from the sql server every 2 seconds, so it's basically realtime. Thanks, Mike "Jim Rech" wrote: It should be easy to update Excel's title bar. Just right click your worksheet's tab and pick View Code. Then paste this in: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Target.Value End Sub -- Jim "Mike K" wrote in message ... Oh wise ones, Is it possible to display the value of a cell in the Excel title bar or the system tray. You can see what I'm getting at, monitoring the value of a cell while excel is minimized. This value is constantly changing every 2 seconds from a sheet calculation macro, so the Title/Tray would have to change dynamically. Mike |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mike
I dont now where I fond this, but you could modifi it. put this in ThiWorkbook Private Sub Workbook_BeforeClose(Cancel As Boolean) ' Stops the clok On Error Resume Next Application.OnTime NextSecond, "Update", , False End Sub Private Sub Workbook_Open() Update End Sub Put this in a module. Option Explicit Dim NextSecond As Variant Sub Update() ThisWorkbook.Sheets(1).Calculate ' update every second NextSecond = Now + TimeValue("00:00:01") Application.OnTime NextSecond, "Update" End Sub Regards Yngve |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Evgny,
Thanks for the reply. Let me clarify though. I already have a sheet that updates every 2 seconds and displays the production line speed in cell D2. I wanted to able to see the value of that cell in the Windows taskbar or tray. If I can get it displayed in the excel title bar I can view it in the taskbar even if I'm in another app. The problem is that the line constantly flucuates and even stops. So the excel titlebar has to be updated dynamically so I can see a stopped production line while I'm in, say Outlook, and respond. Thanks, Mike "evgny" wrote: Hi Mike I dont now where I fond this, but you could modifi it. put this in ThiWorkbook Private Sub Workbook_BeforeClose(Cancel As Boolean) ' Stops the clok On Error Resume Next Application.OnTime NextSecond, "Update", , False End Sub Private Sub Workbook_Open() Update End Sub Put this in a module. Option Explicit Dim NextSecond As Variant Sub Update() ThisWorkbook.Sheets(1).Calculate ' update every second NextSecond = Now + TimeValue("00:00:01") Application.OnTime NextSecond, "Update" End Sub Regards Yngve |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If _another_ cell changes I assume that triggers the change event. But
first the sheet should recalc. So... 1. Some cell changes 2. Sheet recalcs due to automatic calc mode 3. Our change event handler is called due to #1 Revised code to handle #3: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Range("A1").Value End Sub Change A1 to the cell you want to see the value for. Another option is to put the same code as above in calc event handler: Private Sub Worksheet_Calculate() Application.Caption = Range("A1").Value End Sub -- Jim "Mike K" wrote in message ... Jim, I was afraid of this. I works if I manually change the value in the active cell, but this cell changes based on a sheet recalculation, not a change event. The intial value is displayed and remains static. Any other sugestions that may work with a worksheet calculation event? This value is the speed of a manufacturing line pulled from the sql server every 2 seconds, so it's basically realtime. Thanks, Mike "Jim Rech" wrote: It should be easy to update Excel's title bar. Just right click your worksheet's tab and pick View Code. Then paste this in: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Target.Value End Sub -- Jim "Mike K" wrote in message ... Oh wise ones, Is it possible to display the value of a cell in the Excel title bar or the system tray. You can see what I'm getting at, monitoring the value of a cell while excel is minimized. This value is constantly changing every 2 seconds from a sheet calculation macro, so the Title/Tray would have to change dynamically. Mike |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
I ended up using the second option and it works like a charm. Thanks so much for your help. Mike "Jim Rech" wrote: If _another_ cell changes I assume that triggers the change event. But first the sheet should recalc. So... 1. Some cell changes 2. Sheet recalcs due to automatic calc mode 3. Our change event handler is called due to #1 Revised code to handle #3: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Range("A1").Value End Sub Change A1 to the cell you want to see the value for. Another option is to put the same code as above in calc event handler: Private Sub Worksheet_Calculate() Application.Caption = Range("A1").Value End Sub -- Jim "Mike K" wrote in message ... Jim, I was afraid of this. I works if I manually change the value in the active cell, but this cell changes based on a sheet recalculation, not a change event. The intial value is displayed and remains static. Any other sugestions that may work with a worksheet calculation event? This value is the speed of a manufacturing line pulled from the sql server every 2 seconds, so it's basically realtime. Thanks, Mike "Jim Rech" wrote: It should be easy to update Excel's title bar. Just right click your worksheet's tab and pick View Code. Then paste this in: Private Sub Worksheet_Change(ByVal Target As Range) Application.Caption = Target.Value End Sub -- Jim "Mike K" wrote in message ... Oh wise ones, Is it possible to display the value of a cell in the Excel title bar or the system tray. You can see what I'm getting at, monitoring the value of a cell while excel is minimized. This value is constantly changing every 2 seconds from a sheet calculation macro, so the Title/Tray would have to change dynamically. Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Display a message in system tray | Excel Discussion (Misc queries) | |||
How do I open an Excel file on XP system, saved on a Vista system | Excel Discussion (Misc queries) | |||
Default Paper Tray | Excel Discussion (Misc queries) | |||
System Tray Notification/Alert | Excel Programming | |||
Print all worksheets from same tray | Excel Programming |