List Boxes Font Size

raccoon588

Board Regular
Joined
Aug 5, 2016
Messages
118
I have 42 list boxes. When the file is opened on a different PC and then i reopen it on mine the font shrinks. Is there a way to loop through all 42 boxes when the file is opened and set the all to font size 24?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
if these are activex controls, you can do it this way

Code:
For Each OLEobj In ActiveSheet.OLEObjects
MsgBox OLEobj.progID
If OLEobj.progID = "Forms.ListBox.1" Then
   ' OLEobj
    OLEobj.Object.Font.Size = 24
End If
Next OLEobj
End Sub
 
Upvote 0
That answer works for me. I was trying to answer this post but could not come up with a answer.
I've looped through UserForm controls before but not activex controls.

if these are activex controls, you can do it this way

Code:
For Each OLEobj In ActiveSheet.OLEObjects
MsgBox OLEobj.progID
If OLEobj.progID = "Forms.ListBox.1" Then
   ' OLEobj
    OLEobj.Object.Font.Size = 24
End If
Next OLEobj
End Sub
 
Upvote 0
Sorry, I left the message box in, just delete it.
 
Upvote 0

Forum statistics

Threads
1,215,391
Messages
6,124,674
Members
449,179
Latest member
fcarfagna

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