VB能不能实现excel中的筛选
发布网友
发布时间:2022-09-18 06:16
我来回答
共1个回答
热心网友
时间:2023-10-20 17:17
可以实现的;
Private Type num
xuhao As Integer
i As Integer
End Type
Dim a(10) As num
Dim temp As num
Private Sub Command1_Click()
For i = 1 To 10
a(i).i = InputBox("请输入第" & i & "个数字")
a(i).xuhao = i
Print a(i).i
Next i
For i = 1 To 10
For j = 1 To 10 - i
If a(j).i > a(j + 1).i Then
temp = a(j + 1)
a(j + 1) = a(j)
a(j) = temp
End If
Next j
Next i
Print
Print "最大数字是" & a(10).i & " 位置是" & a(10).xuhao
End Sub