hi, i need to display the values in the txt file into excel, the values are look like matrix.
How can i do it? This is what I got so far.
but how can I display the value in excel??
Thank you
How can i do it? This is what I got so far.
Code:
Dim n As Integer, i As Integer, j As Integer, solCost As Integer
Dim inputFileName As String, groupSize As Integer
'Ask the user for the input file name. The data in the input file is assumed to be in the right format
inputFileName = InputBox("Enter Problem Filename (include .txt extension)")
inputFileName = ActiveWorkbook.Path & "\" & inputFileName
Open inputFileName For Input As #1
'Now read in the variable n at the top of the file which is the size of the matrix
Input #1, n
'Now construct the (n x n) matrix that will hold the problem and read in the problem from the input file
ReDim ProbMatrix(1 To n, 1 To n) As Integer
For i = 1 To n
For j = 1 To n
Input #1, ProbMatrix(i, j)
Next j
Next i
'Having read the problem we close the input file
Close #1
Thank you