Macro Control

  • Thread starter Thread starter faureman via OfficeKB.com
  • Start date Start date
F

faureman via OfficeKB.com

In Excel, I'm using 2 files (New CU.xls and Error CU.xls) as video
scoreboards. I want to show them at the same time on a single screen space.
"New CU" takes up 80% of the screen and "Error CU" takes up the remaining 20%
as a vertical column on the right.

Upon opening, the primary file (New CU.xls) - calls the secondary file (Error
CU.xls) to open. New CU has several sheets that rotate into the display
window. The following code is used to do this in New CU (and should ONLY work
New CU):

Sub SelectSh1()
Sheets("Sheet1").Select
Application.OnTime Now + TimeValue("00:00:30"), "SelectSh2"
End Sub
Sub SelectSh2()
Sheets("Sheet2").Select
Application.OnTime Now + TimeValue("00:00:30"), "SelectSh1"
End Sub

The issue is that this logic tries to execute in Error CU.xls when it has the
focus. Error CU.xls only has a single sheet (called Alert) that is ONLY used
to display and turn off alerts when required - nothing more.

My question is how to use properties to ensure that the sheet rotation Macros
only apply to New CU.

Also, New CU.xls should keep and regain the focus. Error CU.xls should only
take focus to display or turn off an alert.

Please help.
 
Try specifying the workbook
Sub SelectSh1()
workbooks("CU").Sheets("Sheet1").select
Application.OnTime Now + TimeValue("00:00:30"), "SelectSh2"
End Sub
 
In essence, simply open up the select part of my existing statement to
include the workbook! I will try it - and I'm humbled by its simplicity! I
wasn't sure if I had to use properties to control the macro itself, saying
that it should only apply to New CU.xls (and not Error CU.xls)

THANK YOU.

Now... what might you offer me about this secondary sheet and the control
issue.

For example, I want it to take control to display an alert like "Station 1
Down" - then throw focus back to "New CU" until the cell reference updates it
to clear. When it clears, I want it to regain control, clear the message and
relinquish focus again.

Does that make sense?
 
I'm not quite sure exacly what you are trying to do.

You might want to look at using activate instead of select.
 

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

Back
Top