Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Limit textbox to 255 characters

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Limit textbox to 255 characters

Hi,

You could use the textbox property "Maxlenght".
Regards
JY

"vqthomf" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Character limit in textbox Ashley Excel Worksheet Functions 1 September 10th 08 01:33 AM
Limit Number Of Characters Allowed In A TextBox mastermind Excel Programming 4 May 18th 07 05:27 AM
limit character in textbox Steph[_6_] Excel Programming 2 October 6th 05 09:55 PM
Limit input in a textbox James Agostinho Excel Programming 2 September 10th 03 03:10 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"