TryingToLearn
Well-known Member
- Joined
- Sep 10, 2003
- Messages
- 733
I'm trying to import all but the first 9 lines of a CSV. File opens and I can dump the 1st 9 lines but all data is enclosed in quotes. 1. How can I lose the quotes which are not in the CSV file?
2. Is there an easier way to skip the first x lines? TIA
i.e
2. Is there an easier way to skip the first x lines? TIA
i.e
"BKO 12/31 XXXXX47167 DEPOSIT *MOBILE " | "300.00" | "4788.77" |
[td width="15.1958%"]
1/2/2024
[/td]
VBA Code:
fName = Application.GetOpenFilename("C:\Users\owner\Documents\Finance\BOA\""Text Files (*.csv), *.csv")
If fName = "False" Then Exit Sub
Open fName For Input As #1
rw = 1
If tst Then Stop
Do Until EOF(1)
START9:
Line Input #1, linefromfile
lineitems = split(linefromfile, ",") 'split on commas
For cl = 0 To UBound(lineitems)
If rw < 9 Then
cl = cl + 1
rw = rw + 1
GoTo START9:
End If
ActiveSheet.Cells(rw, cl + 1) = lineitems(cl)
Next cl
rw = rw + 1
Loop
Close #1