Prev: Querying Data from Access
Next: VBA Custom Toolbar
From: Cerberus on 20 Jan 2010 09:25 I want to use a shortcut key (Ctrl+z) to activate a UserForm but don't know for sure it is possible or how to go about it. I've always used a Command Button or a _Click() in the past. Any ideas on how to go about this? Thanks in advance.
From: Ryan H on 20 Jan 2010 09:36 I wouldn't recommend using Ctrl + z, because that is the undo method for Office. Your users may not like that. -- Cheers, Ryan "Cerberus" wrote: > I want to use a shortcut key (Ctrl+z) to activate a UserForm but don't know > for sure it is possible or how to go about it. I've always used a Command > Button or a _Click() in the past. Any ideas on how to go about this? Thanks > in advance. >
From: Peter T on 20 Jan 2010 11:13 As Ryan Says, probably best not to use Ctrl Z. Try the following in the open/close events to add/remove a shortcut for Shift-Ctrl-Z, to call your macro that shows the form Sub auto_Open() Application.OnKey "+^Z", ThisWorkbook.Name & "!ShowFrmMyStuff" End Sub Sub Auto_Close() Application.OnKey "+^Z" End Sub Sub ShowFrmMyStuff() UserForm1.Show End Sub Regards, Peter T "Cerberus" <jpoguejr(a)trinitytrailer.com> wrote in message news:F75653ED-16A9-421C-9C94-3C9DAB53AD38(a)microsoft.com... >I want to use a shortcut key (Ctrl+z) to activate a UserForm but don't know > for sure it is possible or how to go about it. I've always used a Command > Button or a _Click() in the past. Any ideas on how to go about this? > Thanks > in advance. >
|
Pages: 1 Prev: Querying Data from Access Next: VBA Custom Toolbar |