View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Hi Mr. Ogilvy how to Ctl+s to save workbook from Active UserForm

Assume the useform is modal.
Maybe something like this code in the userform module

Private Declare Function GetKeyState Lib "user32" _
(ByVal nVirtKey As Long) As Integer

Const VK_CONTROL As Integer = &H11 'Ctrl


Private Sub TextBox1_KeyDown(ByVal KeyCode _
As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim ctrl as Boolean
If GetKeyState(VK_CONTROL) < 0 Then _
ctrl = True Else ctrl = False
If KeyCode = 83 Then
If ctrl Then
KeyCode = 0
ThisWorkbook.Save
End If
End If
End Sub

You would need to use the KeyDown event of all controls on the Userform.

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
Hi all,

Somebody I wish to solve this ,,,
Ia have a userform that interact with a WorBook,
All I want now is to save that WorkBook from active UserForm
by press Ctrl+s ...

Somebody please help me...

May be Mr. Tom Ogilvy the MVP can to this or someone else please ...!

Thanks and Regards,

Halim