5 Years
Discussion Span
Last Post by samsylvestertty

a Normal if then statement will suffice here. You do need to give us more information though - how/Where do you get the numbers?, where are they used, is it displayed in a list etc?

'I lost touch with VB6
'If the code has any errors do notify

Dim arrayValues(ARRAY_LENGTH) As Integer 'Hope u fill the arrayValues
Dim iter As Integer 'Iterator
Dim biggestNumber As Integer 'Temporary Variable

biggestNumber = arrayValues(0)

For iter = 1 To UBound(arrayValues) - 1
    If arrayValues(iter) > biggestNumber Then
        biggestNumber = arrayValues(iter)
    End If
Next iter

MsgBox biggestNumber


assign the first number of the array in a Temporary variable (biggestNumber).
Repeatedly check all the other array elements with biggestNumber
If the array element is greater than the biggestNumber then assingn that element to biggestNumber

At the end of the iteration you will find the biggestNumber having the biggest number

Hope that helps

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.