N
Neo2
Hello everybody,
Thank you very much for helping us and teaching us so many tricks. I learn
vba thanks to you !
My problem :
I have got several .csv files with data.
When I open one of these files in Excel, the data (that I need) is in row R
and column C.
Now, knowing R and C, I want to get this specific data for the other .csv
files without opening them.
Currently, I use this program:
Dim strFileToLoad As String
Dim aContent() As Variant
Dim lngRowNb As Long
Dim lngColumnNb As Long
Dim lngFa As Long
Dim lngRow As Long
Dim lngColumn As Long
Dim vInputData As Variant
lngFa = FreeFile
Open strFileToLoad For Input As #lngFa
For lngRow = 1 To lngRowNb
For lngColumn = 1 To lngColumnNb
Input #lngFa, vInputData
aContent(lngRow, lngColumn) = vInputData
Next lngColumn
Next lngRow
Close
Then, my data is in aContent(R, C).
NB:
* aContent(R, C) is typically a string or a number with no fix number of
characters/figures.
* I do not need the full aContent array just aContent(R, C).
Is there another way? An easier way? A faster way?
Could I use FileSystemObject or VBScript, anywhere?
Thank you.
Thank you very much for helping us and teaching us so many tricks. I learn
vba thanks to you !
My problem :
I have got several .csv files with data.
When I open one of these files in Excel, the data (that I need) is in row R
and column C.
Now, knowing R and C, I want to get this specific data for the other .csv
files without opening them.
Currently, I use this program:
Dim strFileToLoad As String
Dim aContent() As Variant
Dim lngRowNb As Long
Dim lngColumnNb As Long
Dim lngFa As Long
Dim lngRow As Long
Dim lngColumn As Long
Dim vInputData As Variant
lngFa = FreeFile
Open strFileToLoad For Input As #lngFa
For lngRow = 1 To lngRowNb
For lngColumn = 1 To lngColumnNb
Input #lngFa, vInputData
aContent(lngRow, lngColumn) = vInputData
Next lngColumn
Next lngRow
Close
Then, my data is in aContent(R, C).
NB:
* aContent(R, C) is typically a string or a number with no fix number of
characters/figures.
* I do not need the full aContent array just aContent(R, C).
Is there another way? An easier way? A faster way?
Could I use FileSystemObject or VBScript, anywhere?
Thank you.