Thread: vba outcome
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default vba outcome

1. You haven't defined what length is, nor the array A.
2. You mix upper and lower case i and j.
3. On your 7th line you have a closed bracket before the j+1 term -
should be open bracket.
4. Your 8th line does not make sense.

As for the outcome, are you trying to do a crude bubble sort?

Hope this helps.

Pete

On Aug 29, 12:19 pm, harry buggy wrote:
can anyone tell me if theres any errors in this and what the outcome
would be?

sub test ()

dim I, J As Integer
dim x as single
for i = 1 to length
for j = 1 to (length - i)
If A(j) < A )j +1) Then
x = a(j +1) = A(j)
A(j) = x
end if
next j
next i
end sub