How to Extract Data from a CSV file???

  • Thread starter Thread starter hce
  • Start date Start date
H

hce

I need help on how to write a VB command that will allow me to extract
data from a specified column in a CSV file. I have written a command in
VB to extract all data from the CSV file and paste it on an excel
worksheet. This method is working fine but because the file is too big,
it takes a long time for me to extract everything. I only need the data
from one column so if anyone out there can help me with this, I would
be extremely grateful...

Cheers
 
open "c:\whatever.csv" for input as #1
counter =1
Do while not EOF(1)
input #1, col1,col2 ... ,colInterest,(etc)

' input all columns, but only use the one u 'want -- make sure and add
a variable 'representing every col

'displaypage - whatever page you want to 'display to

displaypage.cells(counter,1).value = colInterest : counter = counter +
1

Loop
CLOSE #1
displaypage.activate
 
Back
Top