Controls Resize and Resize Font in Controls in a Worksheet

yadavrahul143

New Member
Joined
Nov 1, 2006
Messages
39
Hi All,

i have written a code to adjust the height and width of controls on worksheet according to Resolution.

but while changing the font size listbox loses prior selections.

I have attached the worksheet that i am working on.

Thanks
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Perhaps something like this before/after
Code:
'=============================================================================
'- SAVE LISTBOX (CONTROLS TOOLBAR) SELECTIONS TO WORKSHEET CELLS A1 DOWN
'- FOR LATER RECOVERY
'- Brian Baulsom August 2004
'=============================================================================
Dim MyBox As Object
Dim ToRow As Long
Dim ListBoxItem As Integer
'=============================================================================
'- SAVE SELECTION INFO
'=============================================================================
Sub ReadBox()
    ToRow = 1
    Set MyBox = ActiveSheet.ListBox1
    '-------------------------------------------------------------------------
    '- LOOP LISTBOX ITEMS
    For ListBoxItem = 0 To MyBox.ListCount - 1
        ActiveSheet.Cells(ToRow, 1).Value = MyBox.Selected(ListBoxItem)
        ToRow = ToRow + 1
    Next
End Sub
'=============================================================================
'- READ CELLS & RE-SELECT ITEMS
'=============================================================================
Sub ReSelect()
    ToRow = 1
    Set MyBox = ActiveSheet.ListBox1
    '-------------------------------------------------------------------------
    '- LOOP LISTBOX ITEMS
    For ListBoxItem = 0 To MyBox.ListCount - 1
        MyBox.Selected(ListBoxItem) = ActiveSheet.Cells(ToRow, 1).Value
        ToRow = ToRow + 1
    Next
End Sub
'-----------------------------------------------------------------------------
 
Upvote 0

Forum statistics

Threads
1,216,115
Messages
6,128,919
Members
449,478
Latest member
Davenil

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