tengo un archivo de texto con 100 numeros
que se construyen aleatoriamente
45
14
2
63
5
7
6
22
.
.
.
y este es el codigo con que capturo los datos
Private Const NUM_TEXTBOX = 6
Private Function Cargar_Valores(ByRef Valores() As Integer) As Integer
Dim Fichero As Integer
Dim i As Integer
Dim Aux As String
Dim n1 As Integer
Dim lHay As Boolean
Fichero = FreeFile()
Open "D:\Texto.txt" For Input As #Fichero
i = 0
Do While Not EOF(Fichero)
ReDim Preserve Valores(i)
Line Input #Fichero, Aux
' son los numeros del 1 hasta 15
If CInt(Aux) > 0 And CInt(Aux) <= 15 Then
' evalua datos que no sean repetidos
lHay = False
For n1 = 0 To i - 1
If Aux = Valores(n1) Then
lHay = True
Exit For
End If
Next
If lHay = False Then
ReDim Preserve Valores(i)
Valores(i) = CInt(Aux)
i = i + 1
If i = 6 Then
Exit Do
End If
End If
End If
Loop
Cargar_Valores = i + 1
End Function
Private Sub Mostrar_Valores(ByRef Valores() As Integer)
Dim i As Integer
For i = 0 To NUM_TEXTBOX - 1
txtdatob(i) = Valores(i)
Next i
Mi pregunta es si puedo trear el ultimo dato del archivo pero sin modificar los mismos 5 o 4 numeros que traigo