Lock the size of an Active X object or make relevant to the worksheets zoom

Tanner_2004

Well-known Member
Joined
Jun 1, 2010
Messages
616
Hello. I have two Active X Listboxes. They are on a worksheet that is zoomed to 75% via a macro. I keep have to re-size the listboxes after I close and open the workbook. Is there a way to change the properties of the listboxes to stay the same that I made them by dragging the points in design mode to re-size them? They keep returninhg to their smaller size.

Thank you,
 

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.
Hello Tony
This is one possible solution, just alter the values to suit:

Code:
' this code goes at the sheet module


Private Sub Worksheet_Activate()
    
    Me.ListBox1.Height = 80
    Me.ListBox1.Width = 110


End Sub
 
Upvote 0
Thank you. I will give it a try. It's funny, when I send the file to someone else they can open and close the file without the dimensions changing back. maybe it a global Excel setting that it casuing this(?). I will try now..thank you again.
 
Upvote 0
You are so welcome. Did you see my other one about selecting a parent selection from a listbox to select related "child" selections?
 
Upvote 0
Is there a way for this launch when the workbook opens? The reason I ask is that the boxes shrinks in dimension when I initially open the workbook. I have to leave the worksheet, then return to it for the macro to launch and the boxes to size to the dimensions in the macro. I am surprised that an Active X control doesn't let one "fix" the dimension properties.

Any thoughts?
 
Upvote 0
Sure:

Code:
' this goes at ThisWorkbook module


Private Sub Workbook_Open()
        
    With Me.Worksheets("Sheet2").ListBox1
        .Height = 80
        .Width = 110
    End With
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,581
Messages
6,114,463
Members
448,573
Latest member
BEDE

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
Back
Top