Sub
ReadfromCSVSimple(fname
As
Variant
,
Optional
fs
As
String
=
";"
)
Dim
hfile
As
Integer
Dim
lAnzahl
As
Long
Dim
OneLine
As
String
Dim
myArr
As
Variant
Dim
myArrRows
As
Variant
Dim
lnglast
As
Long
Dim
zeichen
As
Variant
Dim
iCnt
As
Integer
ThisWorkbook.Worksheets(
"Projektübersicht"
).
Select
lnglast = Cells(Rows.Count, 1).
End
(xlUp).Row
If
IsEmpty(Cells(lnglast, 1))
Then
lnglast = Cells(lnglast, 1).
End
(xlUp).Row
lnglast = lnglast + 1
hfile = FreeFile
Open fname
For
Input
As
#hfile
Line Input #hfile, OneLine
If
OneLine <>
""
Then
myArrRows = Split(OneLine, Chr(10))
myArr = Split(OneLine, fs)
myArr = Split(myArrRows(iCnt), fs)
If
UBound(myArr) > 1
Then
With
Worksheets(
"Projektübersicht"
)
.Cells(lnglast, 33) = Replace(myArr(15), Chr$(34), vbNullString)
.Cells(lnglast, 37) = Replace(myArr(17), Chr$(34), vbNullString)
.Cells(lnglast, 35) = Replace(myArr(18), Chr$(34), vbNullString)