Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I add a button {from form controls} to the active sheet if I
want it to be in a specific position? Ideally, I want the button to be aligned in one row and contained between three columns - my problem is that I won't know before hand which row I want to restrict by. The sheet I'm dealing with will have a variable amount of data every time it is generated by my code, and I always want the button to be at the end of the data. Any ideas? -bgetson |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
something along these lines:
Sub AD() With Cells(Cells(Rows.Count, 1).End(xlUp).Row, 10) Set btn = ActiveSheet.Buttons.Add( _ Left:=.Left, _ Top:=.Top, _ Width:=.Resize(1, 3).Width, _ Height:=.Height) End With btn.OnAction = "MyMacro" End Sub -- Regards, Tom Ogilvy " wrote: How can I add a button {from form controls} to the active sheet if I want it to be in a specific position? Ideally, I want the button to be aligned in one row and contained between three columns - my problem is that I won't know before hand which row I want to restrict by. The sheet I'm dealing with will have a variable amount of data every time it is generated by my code, and I always want the button to be at the end of the data. Any ideas? -bgetson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you so much for your help. To be honest, when I'd asked for
help, I'd basically resigned myself to reformatting everything so that my buttons were on top and everything else displayed underneath. The code you provided works perfectly, and I can easily get it to work for my project. Thanks again. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding a Button | Excel Discussion (Misc queries) | |||
Adding a button with Add-in | Excel Programming | |||
Adding .xla button for Toggle Calculation Button | Excel Programming | |||
Adding a button | Excel Programming | |||
adding button for add-in | Excel Programming |