Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default how do i programmatically insert a button on a worksheet

i want to programatically insert a command button into a worksheet that is
not the active worksheet. I dont care about placement, size , just that the
command button is on worksheet "main" and the command button is "emp1".

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default how do i programmatically insert a button on a worksheet

Something like this

Sub Test()
InsertButton Workbooks("Book2").Sheets(1), 0, 0, 200, 100, "test", "test",
"test"
End Sub

Sub InsertButton(shName As Worksheet, _
Top As Double, Left As Double, Width As Double, Height As Double, _
Action As String, Caption As String, Name As String)
Dim bInsert As Object

'add the control button
Set bInsert = shName.Buttons.Add(Left, Top, Width, Height)
bInsert.OnAction = Action
bInsert.Characters.Text = Caption
bInsert.Name = Name

End Sub

Robin Hammond
www.enhanceddatasystems.com

"Qaspec" wrote in message
...
i want to programatically insert a command button into a worksheet that is
not the active worksheet. I dont care about placement, size , just that
the
command button is on worksheet "main" and the command button is "emp1".

thanks



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
Insert select button on excel worksheet to auto transfer data. Gryndar Excel Worksheet Functions 2 November 23rd 08 10:36 PM
How to insert a macro button in a worksheet laurlang Excel Discussion (Misc queries) 1 November 2nd 07 02:11 PM
How do I insert a drop down list button from an excel worksheet? Visiting Angel Excel Worksheet Functions 2 September 25th 06 10:19 PM
INSERT A PRINT BUTTON ON A WORKSHEET OFFICEBOY10 Excel Discussion (Misc queries) 1 February 6th 06 11:36 AM
programmatically insert multiple blank rows in worksheet tag Excel Programming 3 July 31st 03 05:03 AM


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

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

About Us

"It's about Microsoft Excel"