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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

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,102,042
Messages
5,484,356
Members
407,437
Latest member
alfaroM

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top