habe ein problem, ich öffne mit einem makro ein neues tabellenblatt. bisher ist es so das es immer ein neues Blatt ist. Ich will aber das die daten der csv datei in einem Tabellenblatt names vormonat geöffnet wird, welches schon exsistiert. Habe es schon mit sovielen befehlen ausprobiert es einfach nicht funktionieren für Hilf wäre ich euch sher dankbar.
Liebe Grüße Euer Lolie
Sub Öffnen()
Dim strTmp As String
Dim arrTmp As Variant
Dim lngRow As Long
Dim wks As Worksheet
Dim sFile As String
Application.ScreenUpdating = False
sFile = Range("B3").Value
If Dir(sFile) = "" Then
Beep
MsgBox "Datei wurde nicht gefunden!"
Exit Sub
End If
On Error GoTo ERRORHANDLER
Application.EnableEvents = False
With ThisWorkbook
Set wks = .Worksheets.Add(after:=Worksheets(.Worksheets.Count))
End With
Open sFile For Input As #1
While Not EOF(1)
lngRow = lngRow + 1
Line Input #1, strTmp
arrTmp = Split(strTmp, ";")
With wks.Range(Cells(lngRow, 1), Cells(lngRow, UBound(arrTmp) + 1))
.NumberFormat = "@"
.Value = arrTmp
End With
Wend
Close #1
ERRORHANDLER:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub