LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default len of item in an array

Assuming your field delimiter is a comma and that your array is named Record

LenFirstField = Instr(Record(X), ",") - 1

where X is the loop counter (record number). If you need this to be more
general, here is how to

LenOfField_F = Len(Split(Record(X), ",")(F - 1))

where F is 1 for the first field, 2 for the second, etc. and X is as defined
above.

Rick


Is it possible to check the length of each item in a specific field in an
array? Is so, how?

I am building an array but I want to check the length of a specific field
for each item in the array. For example, each "record" in my array has 4
fields. I want to check the length of the first field in each "record".
If
it is greater than 0, I will do one action and if it is zero I will do
another action.

I'm using this in an edit to be verify the user has not selected a record
where the first field is blank.

Thanks for the help.

--
JT


 
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
Second item in list using array CeciliaPDX Excel Worksheet Functions 4 March 10th 09 06:14 PM
Getting a the position of a single item in an array pinkfloydfan Excel Programming 5 July 23rd 07 09:05 PM
Fastest way to find item in an array. WhytheQ Excel Programming 7 May 24th 06 11:12 PM
Lookup Multiple Occurrence Of Item In Array John Sharkey Excel Programming 0 October 29th 04 08:32 PM
does an item belong to an array? wcc Excel Programming 4 October 21st 04 08:46 AM


All times are GMT +1. The time now is 10:32 PM.

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

About Us

"It's about Microsoft Excel"