Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Text Counter as you type

Is there a way to make a cell have a character counter? The cell is validated
to only allow 30 characters. I need to put in a counter that as the person
types, it shows they are on character "13/50" and keeps counting as they type.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Text Counter as you type

macros don't run (for any practical purpose) while a user is editing a cell.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

Is there a way to make a cell have a character counter? The cell is validated
to only allow 30 characters. I need to put in a counter that as the person
types, it shows they are on character "13/50" and keeps counting as they type.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Text Counter as you type

So if I entered a text box, would this be possible?

If not, what is the most practical way to achive this?



"Tom Ogilvy" wrote:

macros don't run (for any practical purpose) while a user is editing a cell.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

Is there a way to make a cell have a character counter? The cell is validated
to only allow 30 characters. I need to put in a counter that as the person
types, it shows they are on character "13/50" and keeps counting as they type.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Text Counter as you type

Yes. A textbox from the control toolbox toolbar has a Change event that
fires on each keystroke, so this would support what you want to do.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

So if I entered a text box, would this be possible?

If not, what is the most practical way to achive this?



"Tom Ogilvy" wrote:

macros don't run (for any practical purpose) while a user is editing a cell.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

Is there a way to make a cell have a character counter? The cell is validated
to only allow 30 characters. I need to put in a counter that as the person
types, it shows they are on character "13/50" and keeps counting as they type.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Text Counter as you type

Not to wear out your patience, but I am an extreme novice in VB. Do you have
a sample of the code I could manipulate?

Thanks again


"Tom Ogilvy" wrote:

Yes. A textbox from the control toolbox toolbar has a Change event that
fires on each keystroke, so this would support what you want to do.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

So if I entered a text box, would this be possible?

If not, what is the most practical way to achive this?



"Tom Ogilvy" wrote:

macros don't run (for any practical purpose) while a user is editing a cell.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

Is there a way to make a cell have a character counter? The cell is validated
to only allow 30 characters. I need to put in a counter that as the person
types, it shows they are on character "13/50" and keeps counting as they type.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Text Counter as you type

put in a textbox from the control toolbox toolbar

Right click on it and select view code.

Put in code like this: (assumes the name is Textbox1)

Private Sub TextBox1_Change()
If Len(TextBox1.Text) 30 Then
TextBox1.Value = Left(TextBox1.Text, 30)
End If
Set rng = TextBox1.TopLeftCell.Offset(0, -1)
rng.Value = "'" & Len(TextBox1.Text) & "/30"
End Sub

--
regards,
Tom Ogilvy


"jeffbert" wrote:

Not to wear out your patience, but I am an extreme novice in VB. Do you have
a sample of the code I could manipulate?

Thanks again


"Tom Ogilvy" wrote:

Yes. A textbox from the control toolbox toolbar has a Change event that
fires on each keystroke, so this would support what you want to do.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

So if I entered a text box, would this be possible?

If not, what is the most practical way to achive this?



"Tom Ogilvy" wrote:

macros don't run (for any practical purpose) while a user is editing a cell.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

Is there a way to make a cell have a character counter? The cell is validated
to only allow 30 characters. I need to put in a counter that as the person
types, it shows they are on character "13/50" and keeps counting as they type.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Text Counter as you type

Works beautifully. Thanks again.


"Tom Ogilvy" wrote:

put in a textbox from the control toolbox toolbar

Right click on it and select view code.

Put in code like this: (assumes the name is Textbox1)

Private Sub TextBox1_Change()
If Len(TextBox1.Text) 30 Then
TextBox1.Value = Left(TextBox1.Text, 30)
End If
Set rng = TextBox1.TopLeftCell.Offset(0, -1)
rng.Value = "'" & Len(TextBox1.Text) & "/30"
End Sub

--
regards,
Tom Ogilvy


"jeffbert" wrote:

Not to wear out your patience, but I am an extreme novice in VB. Do you have
a sample of the code I could manipulate?

Thanks again


"Tom Ogilvy" wrote:

Yes. A textbox from the control toolbox toolbar has a Change event that
fires on each keystroke, so this would support what you want to do.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

So if I entered a text box, would this be possible?

If not, what is the most practical way to achive this?



"Tom Ogilvy" wrote:

macros don't run (for any practical purpose) while a user is editing a cell.

--
Regards,
Tom Ogilvy


"jeffbert" wrote:

Is there a way to make a cell have a character counter? The cell is validated
to only allow 30 characters. I need to put in a counter that as the person
types, it shows they are on character "13/50" and keeps counting as they type.

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
dynamic character counter for merged cell text field JASelep Excel Worksheet Functions 1 August 29th 07 07:24 PM
How do I type text in a cell? j2t2011 New Users to Excel 1 July 28th 07 05:37 AM
how to convert date type to text type Steffen Excel Discussion (Misc queries) 3 July 17th 07 11:32 AM
multiple file uploading - runtime error'13': type mismatch "While Counter <= UBound(FName)" Sinner Excel Discussion (Misc queries) 3 March 1st 07 09:44 AM
I want to type a text in a cell, but I want that text to represen. ExcelQ Excel Discussion (Misc queries) 1 January 21st 05 07:45 PM


All times are GMT +1. The time now is 09:57 AM.

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"