Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Execute Code


Hi all,

I want to execute all the code in a cmdButton on a userform when a
keypress is registerd.


Code:
--------------------

Private Sub UserForm_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 10Then
'goto cmdSearch (execute the cmdSearch Code)
End If
End Sub

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


Any ideas? Thanks!


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=518152

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Execute Code

See amanded code

HTH
--
AP

"gti_jobert" a
écrit dans le message de
...

Hi all,

I want to execute all the code in a cmdButton on a userform when a
keypress is registerd.


Code:
--------------------

Private Sub UserForm_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 10Then

cmdSearch
End If
End Sub

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


Any ideas? Thanks!


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile:

http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=518152



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Execute Code


move the code inside the command button routine into a general modul
(create the module using insert...module and call it as a public sub

eg
public sub doCMD

end sub


then change the cmdbutton code to call doCMD and the keypress i
ascii=10 to call docmd

Hope this helps
regards,

gti_jobert Wrote:
Hi all,

I want to execute all the code in a cmdButton on a userform when
keypress is registerd.


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

Private Sub UserForm_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 10Then
'goto cmdSearch (execute the cmdSearch Code)
End If
End Sub

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


Any ideas? Thanks


--
tony
-----------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=51815

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
how to execute macro from vb 6.0 code? B Deepak Excel Programming 4 September 30th 05 07:57 AM
Code won't execute... Jim Cone Excel Programming 1 August 20th 05 07:22 AM
Execute code on server Steph[_3_] Excel Programming 3 March 28th 05 06:44 PM
Why does this code take so long to execute. John Keith[_2_] Excel Programming 4 March 6th 05 07:44 PM
When does Code Execute on a List Box? John Baker Excel Programming 0 January 11th 05 08:24 PM


All times are GMT +1. The time now is 04:27 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"