How to count characters on multiline cells on Ms Excel?
เธรดต่อผู้เขียนข้อความ: Elizabeth Sánchez León
Elizabeth Sánchez León
Elizabeth Sánchez León  Identity Verified
สเปน
Local time: 16:05
ภาษาอังกฤษ เป็น ภาษาสเปน
+ ...
Sep 4, 2008

I have been searching for this topic and I have not found much information.

I have an .xsl file with cells having severals lines on each one. Each cell has a different character limitation, both in the no. of accepted lines and in the no. of accepted characters per line. Does anyone know an efficient way to count both the lines and the characters per line of each cell? I know how to use the LENGTH function of Ms Excel, but I think here I need something more sophisticated.

... See more
I have been searching for this topic and I have not found much information.

I have an .xsl file with cells having severals lines on each one. Each cell has a different character limitation, both in the no. of accepted lines and in the no. of accepted characters per line. Does anyone know an efficient way to count both the lines and the characters per line of each cell? I know how to use the LENGTH function of Ms Excel, but I think here I need something more sophisticated.

Many thanks for your help!
Collapse


 
Antoní­n Otáhal
Antoní­n Otáhal
Local time: 17:05
สมาชิก (2005)
ภาษาอังกฤษ เป็น ภาษาเชค
+ ...
Some programming is needed Sep 4, 2008

The InStrRev function of Visual Basic will come handy (looking up the positions of manual line break "control character" within cell strings):

Description

Returns the position of an occurrence of one string within another, from the end of string.

Syntax

InstrRev(stringcheck, stringmatch[, start[, compare]])


You will find more info in Visual Basic help.

If I were programming it, I would probably export to Word,
... See more
The InStrRev function of Visual Basic will come handy (looking up the positions of manual line break "control character" within cell strings):

Description

Returns the position of an occurrence of one string within another, from the end of string.

Syntax

InstrRev(stringcheck, stringmatch[, start[, compare]])


You will find more info in Visual Basic help.

If I were programming it, I would probably export to Word, or txt or xml, before working further with it - but most likely it can be done even in Excel itself. It mostly depends on your personal taste.

HTH

Antonin

[Edited at 2008-09-04 19:29]
Collapse


 
raptisi
raptisi  Identity Verified
กรีซ
Local time: 18:05
ภาษาอังกฤษ เป็น ภาษากรีซ
+ ...
Cut&Paste Sep 5, 2008

I am not sure if that is exactly what you are asking, but you could copy the Excel content into a Word document and then do the word count there.
Just a suggestion!

[Editado a las 2008-09-05 10:20]


 
Ryan Ginstrom (X)
Ryan Ginstrom (X)
Local time: 00:05
ภาษาญี่ปุ่น เป็น ภาษาอังกฤษ
Using VBA to get the number of lines in an Excel cell Sep 5, 2008

Does anyone know an efficient way to count both the lines and the characters per line of each cell? I know how to use the LENGTH function of Ms Excel, but I think here I need something more sophisticated.


To get the number of lines, you could split the cell's text on the newline character (10).

Lines = Split(Application.ActiveCell.Text, Chr(10))
' array is zero based, so length will be ubound + 1
Debug.Print Str(UBound(Lines) + 1) + " lines"

length will get you the number of characters.

HTH!

[Edited at 2008-09-06 04:22]


 


To report site rules violations or get help, contact a site moderator:

ผู้ไกล่เกลี่ยของฟอรัมนี้
Maya Gorgoshidze[Call to this topic]
Prachya Mruetusatorn[Call to this topic]

You can also contact site staff by submitting a support request »

How to count characters on multiline cells on Ms Excel?






Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
Pastey
Your smart companion app

Pastey is an innovative desktop application that bridges the gap between human expertise and artificial intelligence. With intuitive keyboard shortcuts, Pastey transforms your source text into AI-powered draft translations.

Find out more »