PC Review


Reply
Thread Tools Rating: Thread Rating: 26 votes, 5.00 average.

Display count of characters in a cell while typing.

 
 
Toby Erkson
Guest
Posts: n/a
 
      1st Sep 2004
Not sure if this should be here or in the worksheet.functions newsgroup but I
think here is a safe spot.

As a user types text into a cell I would like to have another cell display the
number of characters that are currently in it. The count has to be 'live',
meaning that as the person is typing the counter is updating, not simply
updating after the user has pressed 'Enter'.

Alternately, a count-down counter would be even nicer ;-)

Suggestions? Search brought up nothing.

--
Toby Erkson
Oregon, USA
Excel 2002 in Windows XP


 
Reply With Quote
 
 
 
 
Frank Kabel
Guest
Posts: n/a
 
      1st Sep 2004
Hi
not really possible as macros don't run while you're in editing mode

--
Regards
Frank Kabel
Frankfurt, Germany

"Toby Erkson" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> Not sure if this should be here or in the worksheet.functions

newsgroup but I
> think here is a safe spot.
>
> As a user types text into a cell I would like to have another cell

display the
> number of characters that are currently in it. The count has to be

'live',
> meaning that as the person is typing the counter is updating, not

simply
> updating after the user has pressed 'Enter'.
>
> Alternately, a count-down counter would be even nicer ;-)
>
> Suggestions? Search brought up nothing.
>
> --
> Toby Erkson
> Oregon, USA
> Excel 2002 in Windows XP
>
>


 
Reply With Quote
 
Toby Erkson
Guest
Posts: n/a
 
      1st Sep 2004
Darn. Thanks :-)

"Frank Kabel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
> not really possible as macros don't run while you're in editing mode
>
> --
> Regards
> Frank Kabel
> Frankfurt, Germany



 
Reply With Quote
 
Earl Kiosterud
Guest
Posts: n/a
 
      2nd Sep 2004
Toby,

If you really need this, a macro could show a form, and you could type into
a text box, and the character count be put in the form (or anywhere else)
via macro code as you type. When done, the typed data could be put into the
cell that was selected when the whole thing started.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Toby Erkson" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Darn. Thanks :-)
>
> "Frank Kabel" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi
> > not really possible as macros don't run while you're in editing mode
> >
> > --
> > Regards
> > Frank Kabel
> > Frankfurt, Germany

>
>



 
Reply With Quote
 
Toby Erkson
Guest
Posts: n/a
 
      2nd Sep 2004
Excellent suggestion! That's something I could probably do myself, thank you
:-)

"Earl Kiosterud" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Toby,
>
> If you really need this, a macro could show a form, and you could type into
> a text box, and the character count be put in the form (or anywhere else)
> via macro code as you type. When done, the typed data could be put into the
> cell that was selected when the whole thing started.
>
> --
> Earl Kiosterud
> mvpearl omitthisword at verizon period net



 
Reply With Quote
 
Earl Kiosterud
Guest
Posts: n/a
 
      2nd Sep 2004
Toby,

Go for it. Some ideas. You could have the form pop up when the user
selects a cell in the relevant column via Worksheet_SelectionChange event.
If it's put up modeless, (XL2000 and up), the user can click on some other
column, and you can have it go away automatically. If the user uses
backspace, you'll need to back the count down, or maybe better yet, count
them each time with something like
Len(TextBox1.Value)
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Toby Erkson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Excellent suggestion! That's something I could probably do myself, thank

you
> :-)
>
> "Earl Kiosterud" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Toby,
> >
> > If you really need this, a macro could show a form, and you could type

into
> > a text box, and the character count be put in the form (or anywhere

else)
> > via macro code as you type. When done, the typed data could be put into

the
> > cell that was selected when the whole thing started.
> >
> > --
> > Earl Kiosterud
> > mvpearl omitthisword at verizon period net

>
>



 
Reply With Quote
 
Toby Erkson
Guest
Posts: n/a
 
      2nd Sep 2004
"Go for it"? ¿What?! I was hoping one of you MVP's would already have such a
program already on one of your web pages or would whip out the code and post
it, saving my lazy brain from more work ;-) LOL, just kidding! Thanks for
the ideas, I'll see if my counterpart wants to go this route.

--
Toby Erkson
Oregon, USA
Excel 2002 in Windows XP

"Earl Kiosterud" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Toby,
>
> Go for it. Some ideas. You could have the form pop up when the user
> selects a cell in the relevant column via Worksheet_SelectionChange event.
> If it's put up modeless, (XL2000 and up), the user can click on some other
> column, and you can have it go away automatically. If the user uses
> backspace, you'll need to back the count down, or maybe better yet, count
> them each time with something like
> Len(TextBox1.Value)
> --
> Earl Kiosterud
> mvpearl omitthisword at verizon period net
> -------------------------------------------
>
> "Toby Erkson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Excellent suggestion! That's something I could probably do myself, thank

> you
> > :-)

....


 
Reply With Quote
 
Earl Kiosterud
Guest
Posts: n/a
 
      3rd Sep 2004
Toby,

This'll get you started. Make UserForm1. Put TextBox1 in it, and a label
and name it lblCharCount, and a button and name it btnOK.

In the sheet module:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then ' are we in column A
UserForm1.TextBox1.Value = ActiveCell.Value ' (note 1)
UserForm1.TextBox1.SetFocus
UserForm1.Show
End If
End Sub

In the code module for UserForm1 (double-click any item in it to open the
code module):

Private Sub btnOK_Click()
Selection = TextBox1.Value ' put data into cell
UserForm1.Hide
Selection.Offset(1, 0).Select ' move down
End Sub

Private Sub TextBox1_Change()
lblCharCount.Caption = Len(TextBox1.Value) ' put current character count
End Sub

Note 1: To prevent the text box from starting with the value of the cell
just entered, change this line to UserForm1.TextBox1.Value = ""

After entering the data into the text box, press Enter twice to save
reaching for the mouse and clicking OK. To get out of the whole deal, click
the X. You may want to put a Cancel button, and/or set it up to press Esc
to kill the user form. You can change this to a modeless userform (Excel
2000 and up) and the user could simply click in another cell outside column
A and the code could make the form go away.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Toby Erkson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Go for it"? ¿What?! I was hoping one of you MVP's would already have

such a
> program already on one of your web pages or would whip out the code and

post
> it, saving my lazy brain from more work ;-) LOL, just kidding! Thanks

for
> the ideas, I'll see if my counterpart wants to go this route.
>
> --
> Toby Erkson
> Oregon, USA
> Excel 2002 in Windows XP
>
> "Earl Kiosterud" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Toby,
> >
> > Go for it. Some ideas. You could have the form pop up when the user
> > selects a cell in the relevant column via Worksheet_SelectionChange

event.
> > If it's put up modeless, (XL2000 and up), the user can click on some

other
> > column, and you can have it go away automatically. If the user uses
> > backspace, you'll need to back the count down, or maybe better yet,

count
> > them each time with something like
> > Len(TextBox1.Value)
> > --
> > Earl Kiosterud
> > mvpearl omitthisword at verizon period net
> > -------------------------------------------
> >
> > "Toby Erkson" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Excellent suggestion! That's something I could probably do myself,

thank
> > you
> > > :-)

> ...
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I count characters WHILE TYPING in Word? Xistnnn Microsoft Word Document Management 1 12th Jun 2009 02:34 AM
Excel Count characters in a textbox to display character count? Shaka215@gmail.com Microsoft Excel Programming 1 8th Feb 2007 06:31 AM
find item in drop down cell by typing the first few characters =?Utf-8?B?bm9uaW5vbg==?= Microsoft Excel Misc 1 17th Apr 2006 02:54 AM
Count # of characters in cell loscherland Microsoft Excel Misc 3 22nd Nov 2004 05:46 PM
count characters in a cell wildman Microsoft Excel Worksheet Functions 2 24th Mar 2004 02:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 PM.