Thread: not use
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mark[_17_] Mark[_17_] is offline
external usenet poster
 
Posts: 95
Default not use

Hi Harald!
I not very smart in VBA, yet.
I write following code, not work good:

(in body workshhet)

Public dd as Date
Sub Worksheet_Change(ByVal Target As Range)
dd = Now
Application.OnTime dd + TimeValue("00:00:05"), "check"
End Sub

(in body module)
Public dd As Date
Sub check()

a = Now
If a - dd < 5 Then
MsgBox "sheet don't used for 5 sek. "
End If
End Sub

My variable dd isn't global why?
Msgbox still on...
I'd like check not used sheet for e.g 5 sek. and if not
used then show info and next check if not used 5 sek.
Please help!

Regards
Mark



-----Original Message-----
I'm not sure I understand this question. But you have to

define every single
event that qualifies for your "in use" definition and put

some code there.

HTH. Best wishes Harald

"Mark" skrev i melding
...
Hi Harald,

How will be in not used userform?
Coridially
Mark


-----Original Message-----
Hi Mark

Use a global Date variable and set it to Now on all

sorts
of events
(Worksheet_change, Worksheet_Selectionchange,

Worksheet_Activate, ... ).
Then have a macro that for certain intervals checks if

this variable is more
than 20 minutes old.

HTH. Best wishes Harald

"Mark" skrev i melding
...
I looking for code - if activeworkbook not use for 20
minutes then stuff ..

Please advise I would be very grateful.

Regards
Mark


.



.