same deal..except popup inc
the same as above except I used the Input box
I assume that is the popup you were asking about.'general form..list1,list2 (Listboxes)
'command1,command2 (Command Buttons)
Option Explicit
Private Sub Command1_Click()
Call BubbleSortNumbers(iArray)
Dim iLoop As Integer
List2.addiem "Sorted Numbers:"
List2.AddItem ""
For iLoop = LBound(iArray) To UBound(iArray)
List2.AddItem iArray(iLoop)
Next iLoop
Command1.Enabled = False
End Sub
Private Sub Command2_Click()
Dim iCount As Integer
Dim sNum
List1.AddItem "Entered Numbers"
List1.AddItem ""
For iCount = 1 To 10
sNum = InputBox("Enter your choice of a number!", "Enter Number")
iArray(iCount) = sNum
List1.AddItem iArray(iCount)
Next iCount
Command2.Enabled = False
End Sub
'=======================================================
'add a bas module and put this code in it
Option Explicit
Public iArray(1 To 10) As Long
'
Public Sub BubbleSortNumbers(iArray As Variant)
Dim lLoop1 As Long
Dim lLoop2 As Long
Dim lTemp As Long
For lLoop1 = UBound(iArray) To LBound(iArray) Step -1
For lLoop2 = LBound(iArray) + 1 To lLoop1
If iArray(lLoop2 - 1) > iArray(lLoop2) Then
lTemp = iArray(lLoop2 - 1)
iArray(lLoop2 - 1) = iArray(lLoop2)
iArray(lLoop2) = lTemp
End If
Next lLoop2
Next lLoop1
End Sub