LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Buttons, onAction and Parameter

Hi,

I am trying to create some buttons on my sheet, that execute a macro on
click. I want to add a parameter or a reference to the button somehow.
The code I have is the following:


With ActiveSheet.Buttons.Add(194, (rownr) * 12.75 - 5, 13, 13)
..Characters.Text = "+"
..Name = artikel
..OnAction = "mymacro"
' .Parameter = name 'this does not work
End With


now in this mymacro i have the following code:


sub mymacro()
' name = CommandBars.ActionControl.Name 'this does not work
' name = Selection.name ' this does not work either


I am a little confused by the differences between the different ways of
creating buttons (buttons.add, shapes.add, oleobjects.add,
commandbars.controls.add)
I don't know which command to use and why. The sheet is created on the
fly and creates a given number of buttons based on other data. What I
need to do is to fill in some data when the buttons are clicked, and
create a combobox somewhere.

Thanks in advance

 
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 choose if I use a parameter or not in a parameter query Arnaud Excel Discussion (Misc queries) 0 March 8th 07 01:19 PM
OnAction Variables Howiee22 Excel Programming 1 August 22nd 04 02:53 AM
OnAction Jim Rech Excel Programming 1 September 5th 03 04:39 PM
OnAction Richard Yang Excel Programming 1 July 15th 03 01:37 PM


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