LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help with silly error

I have a really silly error which is killing me !

When I pass a filled array to a function, it loses all its content once
inside the function, as follows:

*** START CODE SNIPPET

Option Base 1

Sub MyRoutine

ReDim MyArray(3) As Variant

For x = 1 To 3
MyArray(x) = x
Next x

a = bAllFiguresUnique(MyArray()) '<== UBOUND HERE IS 3

End Sub

Function bAllFiguresUnique(ParamArray MyArray() As Variant) As Boolean

bAllFiguresUnique = True

For x = 1 To UBound(MyArray()) '<== UBOUND HERE IS 0
DoEvents
For y = 1 To UBound(MyArray())
DoEvents
If MyArray(x) = MyArray(y) Then
If x = y Then
'Ignore
Else
bAllFiguresUnique = False
Exit Function
End If
End If
Next y
Next x

End Function

*** END CODE SNIPPET

I must be doing something stupid, but I can't work out what !

Thanks in advance for all constructive suggestions.

Nick

 
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
Silly question Darrell_Sarrasin via OfficeKB.com Excel Worksheet Functions 6 May 11th 07 01:08 PM
This is so silly... jsc3489 Excel Worksheet Functions 3 November 10th 05 02:06 PM
Silly little annoyance Setting up and Configuration of Excel 6 December 22nd 04 09:33 PM
Silly I know Terry Klein Excel Programming 4 January 15th 04 11:35 PM
Silly Question Mick Southam Excel Programming 4 January 6th 04 09:32 PM


All times are GMT +1. The time now is 11:59 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"