View Single Post
 
Old 01-10-2018, 10:31 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,138
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

What is the point of this exercise? Why not simply set the changed properties of the controls as you need them when you call the userform?
Code:
Sub Example()
Dim ofrm As New UserForm1
Dim oCtrl As Control
    With ofrm
        For Each oCtrl In ofrm.Controls
            If (TypeName(oCtrl) = "TextBox" Or TypeName(oCtrl) = "CheckBox") Then
                With oCtrl
                    .Font.Size = 12
                    .Font.Name = "Calibri"
                    .Width = 120
                End With
            End If
        Next oCtrl
        .Show
        Unload ofrm
    End With
    Set ofrm = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote