Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Simulating Key Presses in Macros

Hi,

How do I simulate pressing the keys using a macro in Excel. For
example, if I want to simulate pressing the keys Alt+H+A, what should I
do in the macro?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Simulating Key Presses in Macros

Try something like:

Private Sub CommandButton1_Click()
Application.SendKeys ("%ha")
End Sub

If you execute from the vb editor, you get the About box for Visual
Basic, but this brings up about for Excel.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simulating Key Presses in Macros


If it is the About dialog you want to invoke then


Code
-------------------

Sub About()
Application.CommandBars.FindControl(ID:=927).Execu te
End Sub

-------------------

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=52511

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Simulating Key Presses in Macros

Ivan! Sweet! Where do you look for the ID numbers?

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
Simulating a Zodiac with a chart gtslabs Charts and Charting in Excel 2 March 16th 09 07:16 PM
simulating click events ben Excel Programming 6 January 7th 05 04:26 PM
New offering: Class to handle multi key presses in sorted list Robin Hammond[_2_] Excel Programming 9 November 19th 04 08:02 AM
how to Pause a VBA procedure until user presses Enter Paul James[_6_] Excel Programming 15 June 10th 04 12:55 AM
Simulating a synchronous process Russ[_8_] Excel Programming 3 April 28th 04 08:48 PM


All times are GMT +1. The time now is 01:52 PM.

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"