Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Anu Anu is offline
external usenet poster
 
Posts: 3
Default runtime Control and code in VBA

i want to add runtime command button and want to add click event to this button.

Pls help me out .

Thanx in advance.

Anu
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default runtime Control and code in VBA

Anu,

This goes into a userform:

Public WithEvents cmdButton As MSForms.CommandButton

Sub testit()
Set cmdButton = Me.Controls.Add("Forms.CommandButton.1", "cmdMyButton")
cmdButton.Caption = "Click Me"
End Sub

Private Sub cmdButton_Click()
MsgBox "Hello"
End Sub


Rob

"Anu" wrote in message
...
i want to add runtime command button and want to add click event to this

button.

Pls help me out .

Thanx in advance.

Anu



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
runtime error code 1004 Karen Excel Worksheet Functions 1 May 13th 10 12:21 AM
Textbox added to Form at runtime too small, can't control size andchange event won't trigger RCGUA Excel Worksheet Functions 2 December 10th 08 09:34 PM
Textbox added to Form at runtime too small, can't control size andchange event won't trigger RCGUA Excel Worksheet Functions 0 December 10th 08 07:48 PM
Changing the height of a commandbar control (edit box) at runtime simon livings Excel Programming 1 December 13th 03 01:28 AM
RunTime code problem drum118 Excel Programming 4 July 19th 03 12:15 PM


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