Excel VBA ComboBox DropDown Button Size--changed itself

前端 未结 7 1604
忘了有多久
忘了有多久 2020-12-22 07:25

I have a workbook with several comboboxes (and listboxes) and a lot of vba written around them. I\'ve used the same code in the Workbook_Open procedure to format them for we

7条回答
  •  爱一瞬间的悲伤
    2020-12-22 07:34

    I had the same issue, no idea why, but if you resize it, then it becomes normal again. So I inserted the followings to resolve:

    Private Sub ComboBox1_LOSTFocus()
    Application.ScreenUpdating = False
    ActiveSheet.Shapes.Range(Array("ComboBox1")).Select
    ActiveSheet.Shapes("ComboBox1").ScaleWidth 1.25, msoFalse, _
        msoScaleFromTopLeft
    ActiveSheet.Shapes("ComboBox1").ScaleHeight 1.25, msoFalse, _
        msoScaleFromTopLeft
    ActiveSheet.Shapes("ComboBox1").ScaleWidth 0.8, msoFalse, _
        msoScaleFromTopLeft
    ActiveSheet.Shapes("ComboBox1").ScaleHeight 0.8, msoFalse, _
        msoScaleFromTopLeft
    Application.ScreenUpdating = True
    End sub
    

提交回复
热议问题