View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CRayF CRayF is offline
external usenet poster
 
Posts: 115
Default Update Values as soon as a Worksheet becomes active?

I noticed that when I start the Worksheet, the following action is at the top
of my module and does not execute until I click on something on the
Worksheet. In my Worksheet Module I have one SUB().

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not ActiveSheet.Previous Is Nothing Then
Range("A1").Value = ActiveSheet.Previous.Range("A1").Value
End If
€¦more code...

I suspect that by the name of the Sub evens are monitored only when an event
is activated.

Now, how do I code a sub() to execute as soon as the Worksheet becomes
active? And where do I put it?