Hi,
I am using the following code to autosize a textbox on my userform.
I would like to know if it is possible to also:
1. Autosize the actual form so if the textbox becomes 2,3 or 4 lines everything shifts down and the form expands vertically to accomodate.
2. Limit the auto expanding textbox to 4 lines maximum (or limit the total number of characters allowed)?
Private Sub txtChangeDescription_Change()
txtChangeDescription.Width = 360
' to restrict autosize to vertical
If txtChangeDescription.Height > 75 Then
txtChangeDescription.Height = 75
txtChangeDescription.AutoSize = False
'plus
'MultiLine = True
'AutoSize = True
'WordWrap = True
End If
End Sub
thank you
Andrew
I am using the following code to autosize a textbox on my userform.
I would like to know if it is possible to also:
1. Autosize the actual form so if the textbox becomes 2,3 or 4 lines everything shifts down and the form expands vertically to accomodate.
2. Limit the auto expanding textbox to 4 lines maximum (or limit the total number of characters allowed)?
Private Sub txtChangeDescription_Change()
txtChangeDescription.Width = 360
' to restrict autosize to vertical
If txtChangeDescription.Height > 75 Then
txtChangeDescription.Height = 75
txtChangeDescription.AutoSize = False
'plus
'MultiLine = True
'AutoSize = True
'WordWrap = True
End If
End Sub
thank you
Andrew
Last edited: