Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to cause userform to display

Hi all, I know how to make a userform display when a user
selects new from a template, but how do I cause a userform
to display when a certain sequence of keys is
pressed...Ctrl X for example?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default How to cause userform to display

Jim,

You can use the OnKey to assign a macro to key stroke
combination, and then have that macro show the form. For
example,

Sub SetKey()
Application.OnKey "^X","MacroName"
End Sub
Sub MacroName()
UserForm1.Show
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Jim" wrote in message
...
Hi all, I know how to make a userform display when a user
selects new from a template, but how do I cause a userform
to display when a certain sequence of keys is
pressed...Ctrl X for example?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default How to cause userform to display

Insert new module.
Write procedure which shows userform.

Sub ShowMyForm
MyForm.Show
End Sub

Tools - Macro - Macros
Select macro ShowMyForm
Click button Options..
Put there keyboard shortcut...

-----Original Message-----
Hi all, I know how to make a userform display when a user
selects new from a template, but how do I cause a

userform
to display when a certain sequence of keys is
pressed...Ctrl X for example?

Thanks
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to cause userform to display

Thanks Chip, it works perfectly.

-----Original Message-----
Jim,

You can use the OnKey to assign a macro to key stroke
combination, and then have that macro show the form. For
example,

Sub SetKey()
Application.OnKey "^X","MacroName"
End Sub
Sub MacroName()
UserForm1.Show
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Jim" wrote in

message
...
Hi all, I know how to make a userform display when a

user
selects new from a template, but how do I cause a

userform
to display when a certain sequence of keys is
pressed...Ctrl X for example?

Thanks



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to cause userform to display


Jim,

I am not too sure that your understanding of a userform are the same a
mine. The userform that I use is part of the VBE scenario.

Notwithstanding that, if you go to Tools in the Excel menu sheet an
select Macro from the resulting dropdown menu, select 'Record ne
macro..' there is a box that will alow you to add a shortcut key t
activate the macro.

If you already have an existing Macro then instead of 'Record Ne
Macro' select the Macro itself and then Options. The same shortcut ke
facility is available from the reulting dialogue box.

HTH :

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display a Chart in a userform Lisa Charts and Charting in Excel 0 February 12th 09 02:50 PM
display userform at certain time Anthony Excel Worksheet Functions 2 October 29th 08 04:21 PM
display userform Anthony Excel Discussion (Misc queries) 3 February 27th 07 04:02 PM
display status bar value in excel userform? Al B Excel Discussion (Misc queries) 0 November 15th 06 01:21 PM
UserForm - display text message then run code Robert[_13_] Excel Programming 3 September 13th 03 11:37 AM


All times are GMT +1. The time now is 08:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"