Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Reginheraht Fischer   on Nov 12 In MS Office Category.

  
Question Answered By: Fairuzah Alam   on Nov 12

Every time the there is a character entered in textbox you will have to
check if it greater than the limit and if "Yes" then change the height
of the textbox. I have written a function for the same refer to it and
customize it your needs. I hope this helps.

Private Sub TextBox1_Change()
count1 = Len(TextBox1.Text)
If (count1 > 300) Then
MsgBox ("The Max length  you can enter is 299")
Exit Sub
End If
If (count1 > 200) Then
TextBox1.Height = TextBox1.Height + 20
End If
If (count1 > 100) Then
TextBox1.Height = TextBox1.Height + 20
End If
End Sub

Note : If there are more objects below the textbox then you will have to
change the position for below it so that textbox will not overlap on
other objects.

Share: 

 

This Question has 7 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on merged cells formatted by text length for height Or get search suggestion and latest updates.


Tagged: