Solved

Coutnting the char. & string in text area.?

Posted on 2001-09-14
4
153 Views
Last Modified: 2010-05-02
Hello,

       I have to count the strings & char entered by the user in the text area on cliking the button.
Means to say when the button is clicked  a list box shows the tollal count for all characters entered in the text area like A=78 , n=68 , .=90 & so on .
Plz give me the solution to do this.
Thanx for giving me answer.
0
Comment
Question by:arzoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
Bahnass earned 50 total points
ID: 6484380
dim AllAscii(256)

for I = 1 to len(Text1.text)
    AllAscii(asc(mid(AllAscii(I))))=    AllAscii(asc(mid(AllAscii(I))))+1

next

'   then to get that array
for i =1 to 255
    ?     AllAscii(I),
next
0
 
LVL 44

Expert Comment

by:bruintje
ID: 6484391
along the same line

Function AscVal(strInput As String)
Dim RetVal As String, I as long

For I = 1 To Len(strInput)
    RetVal = RetVal & Asc(Mid(strInput, I, 1))
Next I

AscVal = RetVal
End Function

in your code you can use

lngTextValue = AscVal(Textbox1.Text)

:O)Bruintje
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6484392
'Here is the solution
'u can put the cnt any where u want,like list box or text
'box.

Private Sub Command1_Click()

Dim cnt As Integer
Dim i As Integer

For i = 1 To Len(Text1.Text)
    cnt = cnt + Asc(Mid(Text1.Text, i, 1))
Next

MsgBox cnt

End Sub
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6484408
Questions Asked 9
Last 10 Grades Given  
Question Grading Record 0 Answers Graded / 0 Answers Received
Answers  
Questions Answered 0
Last 10 Grades Received  

arzoo u have bad credentials,be prompt.
I also suggest all who read,check their crdentials so thatu will spare ur precious time for a worthy person
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question