Re: count array element in word vba
From: Alex Ivanov (consul_at_collegeclub.com)
Date: 03/03/04
- Next message: Alex Ivanov: "Re: Code for setting "In Line with Text" option"
- Previous message: Peter Hewett: "Re: count array element in word vba"
- In reply to: scott: "count array element in word vba"
- Next in thread: Jezebel: "Re: count array element in word vba"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Mar 2004 15:23:38 -0800
ubound(arrAircraft)?
"scott" <scott@sporticia.com> wrote in message
news:uX37k8WAEHA.740@TK2MSFTNGP12.phx.gbl...
> hi
>
> I have a snippet of code that take a given string and uses 'split' to pop
it
> into an array for me
>
> the string is being split with the space char as the seperator
>
> the problem is that sometimes the string will contain x2 words, other
times
> x3 or x4
>
> is there a way to count or return the number of array elements being
created
> from the split ?
>
> code below
>
> <snip>
> 'need to split aircraft names up for displayy purposes
> strAircraft = Trim(AirCraftBox.Value)
> arrAircraft = Split(strAircraft)
>
> 'most planes have 3 part names
> If Count.arrAircraft() > 2 Then
> strAircraft_Make = arrAircraft(0)
> strAircraft_Model = arrAircraft(1) & " " &
> arrAircraft(2)
> 'gulfs have 2 part names only
> Else
> strAircraft_Make = arrAircraft(0) & " " &
> arrAircraft(1)
> End If
> </snip>
>
> obviously this is not working, is there a method for dealing with this ?
or
> will I have to loop through all elements to determin how many there are
> (seems a little inefficient that way round !)
>
> thanks
>
> _scott
>
>
- Next message: Alex Ivanov: "Re: Code for setting "In Line with Text" option"
- Previous message: Peter Hewett: "Re: count array element in word vba"
- In reply to: scott: "count array element in word vba"
- Next in thread: Jezebel: "Re: count array element in word vba"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|