沈阳思美琪创始人:VBA -Macro-Array

来源:百度文库 编辑:中财网 时间:2024/04/29 12:13:42

Public Sub firstprocedure()
Dim pcount As Integer
Dim grade() As Integer          'we can specify lenth with grade(5),  we can specify with Redim Preserve grade() later
Dim i     As Integer

i = InputBox("pls input number of student:")
 
ReDim Preserve grade(i)     'define array'length

For i = 1 To i

grade(i) = InputBox("pls input grade")

Next

End Sub