View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
vqthomf vqthomf is offline
external usenet poster
 
Posts: 104
Default Limit textbox to 255 characters

Sorry I have worked it out by using the Mid function.
Regards
Charles

"vqthomf" wrote:

Hi I have a textbox that user types in a comment and I want to limit the
input to 255 characters. I am using code as below but when I try to remove
the extra characters I get an error can some help please.
TIA
Charles

Select Case Len(TextBox1.Value)
Case Is = 255
MsgBox "You Have Reached The Input Limit Of 255 Characters"

Case Else
lblCounter1.Caption = "Characters remaining " & (255 -
Len(TextBox1.Value))
End Select