Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default 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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
tod tod is offline
external usenet poster
 
Posts: 114
Default 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.
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zero length string on chart Joe M. Charts and Charting in Excel 1 May 6th 10 03:16 PM
Zero-Length string vs Zero (also a valid value) [email protected] Excel Worksheet Functions 2 January 24th 09 02:18 PM
Finding a string of unknown length in a string of unknown length, Help! Hankjam[_2_] Excel Discussion (Misc queries) 8 July 3rd 08 06:49 PM
Finding cells of different string length. kingie Excel Discussion (Misc queries) 5 March 13th 08 12:31 AM
String length jxbeeman Excel Discussion (Misc queries) 1 January 10th 08 07:01 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"