Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tim Tim is offline
external usenet poster
 
Posts: 408
Default limit comments to only 600 words

I have created a text box but I want the text length to be equal to or less
than 600 words.
How do I do that in Excel 2003 please
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 126
Default limit comments to only 600 words

Assuming you are using the 'Control Toolbox' textbox, in the worksheet module
that the textbox is located [assuming the name of the textbox is TextBox1],
put...

Private Sub TextBox1_Change()
If Len(TextBox1.Value) 600 Then
TextBox1.Value = Left(TextBox1.Value, 600)
End If
End Sub

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Tim" wrote:

I have created a text box but I want the text length to be equal to or less
than 600 words.
How do I do that in Excel 2003 please

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 126
Default limit comments to only 600 words

OOPS!!!
Read your request incorrectly. I first read it as 600 letters.
Here's the correct answer for word count...

Private Sub TextBox1_Change()
Dim iWordCount As Integer

iWordCount = 600

If Len(TextBox1.Value) - Len(Application.WorksheetFunction. _
Substitute(TextBox1.Value, " ", "")) iWordCount - 1 Then
TextBox1.Value = _
Left(TextBox1.Value, Application.WorksheetFunction. _
Find("~", Application.WorksheetFunction. _
Substitute(TextBox1.Value, " ", "~", iWordCount - 1)))
End If

End Sub

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Tim" wrote:

I have created a text box but I want the text length to be equal to or less
than 600 words.
How do I do that in Excel 2003 please

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
How do I display comments (words) as my data in a pivot table? jgirl2 Excel Discussion (Misc queries) 1 June 26th 08 10:37 PM
Limit on number of comments in a worksheet dyowee Excel Discussion (Misc queries) 2 May 29th 08 06:02 AM
Is there an upper limit of text that comments can hold MarkRC Excel Discussion (Misc queries) 4 September 28th 05 02:38 PM
Is there a limit to number of words in a cell in excel? rampam1 Excel Discussion (Misc queries) 1 January 23rd 05 06:07 PM
Nested IF limit or Open parentheses limit Fred Excel Discussion (Misc queries) 5 December 23rd 04 03:34 PM


All times are GMT +1. The time now is 05:42 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"