the random number called "RandomNum" got claculated from the total number of lines in each file. Each line is of the same exact length. I wish to read a different line each time.
My issue is where to place that random number in my code? Every try it generate an error.
[Code)
Open Filename For Input As #1
If Err <> 0 Then
MsgBox "Not found: " & Filename, vbCritical, "ERROR"
Exit Sub
End If
r = 0
c = 0
txt = 0
Application.ScreenUpdating = False
Line Input #1 Data(RandomNum) ' get the data on a random basis from the file
For i = 1 To 81
Char = Mid(Data, i, 1)
If Char <> Chr(34) Then
Rng.Cells(i) = Char
End If
Next i
Close #1 ' #1 is the reference of the file
Application.ScreenUpdating = True
[/Code)]
Bookmarks