View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How do I switch focus from a modeless user form back to the excel.

Anoter possibility is to use appactivate:

An example:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$C$3" Then
UserForm1.Show vbModeless
AppActivate Application.Caption
End If
End Sub


--
Regards,
Tom Ogilvy



"Yoam69" wrote in message
...
When I call a modeless user form, I want to then switch the focus back to

the
excel window that was active when the form was called, but leave the form
active (but not with the focus). Nothing I've tried has worked so far.