10/3

 avatar
user_5602785
vbscript
6 months ago
596 B
1
Indexable
ProgApp
Option Explicit

Sub sort_example()
Dim names() As String, counter As Integer, i As Integer, j as Integer
Dim k As Integer
counter = InputBox("How many names are we sorting?")
ReDim names(1 To counter)
For i = 1 to counter
    names(i) = InputBox("what is the name?")
Next i
For j = 1 To counter
    For k = 1 To counter - 1 
        If names(k) > names(k + 1) Then
            temp = names(k + 1)
            names(k + 1) = names(k)
            Names(k) = temp
        End If
    Next k
Next j
Sheets(2).Range("a1").Select
For 1 = 1 To counter
    ActiveCell.Value = names(1)
Next 1
    
End Sub
Editor is loading...
Leave a Comment