Commandbutton size=false?

Guanjin Peter

Active Member
Joined
May 21, 2008
Messages
429
Hi I'm facing a little problem here. WHenever I select a list from the combobox, it autosizes the columns and rows. Thus it also affects the sizes of the command button and move it out of place.
Is there a command to force the commnad button not to move or resize?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

dafan

Well-known Member
Joined
May 6, 2008
Messages
692
Design mode -> Control button -> Rightclick -> Format Control -> Properties -> Don't move or size with cells.
 
Upvote 0

Guanjin Peter

Active Member
Joined
May 21, 2008
Messages
429
found another alternative is to create the buttons manually on new load, delete on exit.

the below compiles with error. any idea?

Private Sub CommandButton1_Click()
ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False, DisplayAsIcon:=False, Left:=441, Top:=10.5, Width:=130.5, Height:=23.25) = True
End Sub
 
Upvote 0

Case_Germany

Active Member
Joined
May 13, 2008
Messages
408
Hi,

try:

Code:
Sub Test()
    Dim objOLEObject As OLEObject
    Set objOLEObject = ActiveSheet.OLEObjects.Add(ClassType:= _
        "Forms.CommandButton.1", Left:=441, Top:=10.5, _
        Width:=130.5, Height:=23.25)
End Sub
Case_Germany
 
Upvote 0

Forum statistics

Threads
1,191,633
Messages
5,987,783
Members
440,110
Latest member
albertod8

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top