ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   counting characters in a cell (https://www.excelbanter.com/excel-programming/388523-counting-characters-cell.html)

dstiefe

counting characters in a cell
 
how do i count the number of characters in a cell

so if cell A1 has the day = to "05"....how do i know that there are 2
characters in the cell?

thank you

PCLIVE

counting characters in a cell
 
=len(A1)

"dstiefe" wrote in message
...
how do i count the number of characters in a cell

so if cell A1 has the day = to "05"....how do i know that there are 2
characters in the cell?

thank you




dstiefe

counting characters in a cell
 
how do you do it in VBA?

"PCLIVE" wrote:

=len(A1)

"dstiefe" wrote in message
...
how do i count the number of characters in a cell

so if cell A1 has the day = to "05"....how do i know that there are 2
characters in the cell?

thank you





Gary Keramidas

counting characters in a cell
 
basically the same way

Sub test()
Dim numChars As Long
numChars = Len(Worksheets("Sheet1").Range("A1"))
MsgBox numChars
End Sub


--


Gary


"dstiefe" wrote in message
...
how do you do it in VBA?

"PCLIVE" wrote:

=len(A1)

"dstiefe" wrote in message
...
how do i count the number of characters in a cell

so if cell A1 has the day = to "05"....how do i know that there are 2
characters in the cell?

thank you








All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com