Word Count in UserForm

  Desert Andy 16:13 19 Dec 07

Hi, I have designed a userform to be used in Excel. The user is required to enter data into a text box, but is limited to 60 letters. Is there a way of giving an actual letter count real time in another text box or maybe a label, to give the user an idea of how many letters he has got left.

  VoG II 20:24 19 Dec 07

In design mode, right click the text box > View Code. Paste in

Private Sub TextBox1_Change()
TextBox2.Text = 60 - Len(TextBox1.Text) & " characters left"
End Sub

For this to work you need another TextBox called TextBox2.

  VoG II 20:37 19 Dec 07

Actually I think a Label looks better:

Private Sub TextBox1_Change()
Label1 = 60 - Len(TextBox1.Text) & " characters left"
End Sub

This thread is now locked and can not be replied to.

Surface Pro (2017) vs Surface Pro 4

20 groundbreaking 3D animation techniques

How to mine Bitcoin on Mac