'hope this code snippet can serve your purpose
Dim n(4), s As String, i As Integer
'populating the string array
For i = 0 To 4 Step 1
begin:
s = InputBox("Demo of populating an array by accepting name of 5 students." & Chr(10) & "Enter name of student" & i + 1 & " :", "Populating Array")
If s <> "" Then
n(i) = s
Else
MsgBox "No student has null in name."
GoTo begin
End If
Next i
'creating and writing array values into file
Open App.Path & "\name.txt" For Output As #1
For i = 0 To 4 Step 1
Print #1, "Information About Student"
Print #1, "---------------------------------"
Print #1, "Name : " & n(i)
Print #1, "Position in array : " & i
Print #1, "Holding rank : " & i + 1
Print #1, "---------------------------------"
Print #1, ""
Next i
Close #1