Set ActiveX List Box Height

seleseped

Board Regular
Joined
Feb 1, 2005
Messages
59
I believe this has a simple answer but I'm having trouble setting the height of an ActiveX Control List Box. The list box is on an Excel 2013 spreadsheet and I would like to have the list box height be either 0 or 88. This is my code (the list box name is ACEI):

With ActiveSheet.Shapes("ListBoxACEI")
.Visible = True
.Top = Range("B4").Top
.ScaleHeight 0.78, msoFalse, msoScaleFromTopLeft
End With

The first two lines of code (.visible and .top) run properly. The .ScaleHeight line of code is what was recorded when I used the macro recorder to size the list box. The problem is each time the above code is run, the height of the list box gets incrementally larger by inconsistent increments. I tried setting the height using .Height 88 but get an error message "Run-time error '438": Object doesn't support this property or method.' IntegralHeight is set to True (but I have no idea what that means).

Can somebody point out my error. Many thanks in advance.
Seleseped
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

seleseped

Board Regular
Joined
Feb 1, 2005
Messages
59
INDEED it does help! Many thanks. I was following the macro recorder code as an example and was totally led astray. Thank the Heavens for those like you who are willing to give your time and expertise! You saved the day.
 

Watch MrExcel Video

Forum statistics

Threads
1,100,192
Messages
5,473,067
Members
406,844
Latest member
mango22

This Week's Hot Topics

Top