ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting string length (https://www.excelbanter.com/excel-programming/305869-counting-string-length.html)

The Wonder Thing[_3_]

Counting string length
 
Hello all,

I'm trying to count the characters in an element of an array using this code:

mySetLength = mySet(mySetIndex).Characters.Count

But it doesn't work. I've made sure there's actually something in mySet(mySetIndex) when it crashed by removing the .Characters.Count part, and it all checks out. Any idea how to do this correctly?

Thanks in advance.

JE McGimpsey

Counting string length
 
Try

mySetLength = Len(mySet(mySetIndex))

In article ,
"The Wonder Thing" wrote:

Hello all,

I'm trying to count the characters in an element of an array using this code:

mySetLength = mySet(mySetIndex).Characters.Count

But it doesn't work. I've made sure there's actually something in
mySet(mySetIndex) when it crashed by removing the .Characters.Count part, and
it all checks out. Any idea how to do this correctly?

Thanks in advance.


Leo Heuser[_3_]

Counting string length
 
Hello

Try

mySetLength = Len(mySet(mySetIndex))

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"The Wonder Thing" skrev i en
meddelelse ...
Hello all,

I'm trying to count the characters in an element of an array using this

code:

mySetLength = mySet(mySetIndex).Characters.Count

But it doesn't work. I've made sure there's actually something in

mySet(mySetIndex) when it crashed by removing the .Characters.Count part,
and it all checks out. Any idea how to do this correctly?

Thanks in advance.




tod

Counting string length
 
Try LEN, like this:


MySetLength = Len(MyArray(MySetIndex))

tod

-----Original Message-----
Hello all,

I'm trying to count the characters in an element of an

array using this code:

mySetLength = mySet(mySetIndex).Characters.Count

But it doesn't work. I've made sure there's actually

something in mySet(mySetIndex) when it crashed by removing
the .Characters.Count part, and it all checks out. Any
idea how to do this correctly?

Thanks in advance.
.


The Wonder Thing[_3_]

Counting string length
 
Many thanks to both of you. Can't believe I never found that Len() function while looking through the help. That works great.

"Leo Heuser" wrote:

Hello

Try

mySetLength = Len(mySet(mySetIndex))

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"The Wonder Thing" skrev i en
meddelelse ...
Hello all,

I'm trying to count the characters in an element of an array using this

code:

mySetLength = mySet(mySetIndex).Characters.Count

But it doesn't work. I've made sure there's actually something in

mySet(mySetIndex) when it crashed by removing the .Characters.Count part,
and it all checks out. Any idea how to do this correctly?

Thanks in advance.






All times are GMT +1. The time now is 01:40 PM.

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