View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
MikeF[_2_] MikeF[_2_] is offline
external usenet poster
 
Posts: 173
Default UserForm mechanics

Jon,
Works great, thanx.

"Jon Peltier" wrote:

Mike -

Insert

AppActivate Application.Caption

after the .Show command.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"MikeF" wrote in message
...
Thanx Rick.
That does work [I had it opening Modeless previously, from the Properties
menu]. The keyboard is still inactive when the form comes up, as the focus
is
on the form.
But I can live with that picky detail.

"Rick Rothstein" wrote:

To make the worksheets under the UserForm available, show the UserForm as
non-modal...

frmDetail.Show vbModeless

You can Show/Hide (or Unload if you prefer) the UserForm in the
workbook's
SheetActivate event. Put this code in the code window for ThisWorksheet
(right click the Excel icon immediately to the left of the File menu item
on
the menu bar, then select View Code to bring this code window up
immediately)...

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Detail" Then
frmDetail.Show vbModeless
Else
frmDetail.Hide
End If
End Sub

--
Rick (MVP - Excel)


"MikeF" wrote in message
...
Have constructed a UserForm - frmDetail - with command buttons relevant
to
worksheet Detail.
It activates at the worksheet level for the Detail sheet [ie
frmDetail.show].

1. I only want it visible on the Detail sheet. Have tried Unload Me
in
that sheet's DeActivate procedure, but it doesn't work.

2. When the form is activated, it's focus is on the form itself, so
worksheet ops are stalled unless I click somewhere in the worksheet.
Prefer
the focus to remain on the worksheet until a command button on the form
is
clicked, then revert the focus immediately back to the worksheet
automaticall
on that button being clicked.

Note - there are no OK buttons, just command buttons that run
procedures
[ie
Application.Run ...].

Thanx in advance for your assistance.
Regards,
- Mike