ich brauche mal Eure Hilfe.
Folgendes Makro steht in der Mappe Test
Jetzt möchte ich Zeile 2 aus dem Sheet Adü in die Datei Datenbank.xls in den Sheet ADB (Erste freie Zeile) kopieren, irgendwie bekomme ich das nicht hin.
Es wäre toll, wenn mal jemand drüber schaut.
Gruß
Chris
Sub copy()
Sheets("Adü").Select
Dim wks
Dim iRow As Integer, iRowS As Integer
Dim sfile As String
Application.ScreenUpdating = False
sfile = ThisWorkbook.Path & "\Datenbank.xls"
If Dir(sfile) = "" Then
Beep
MsgBox "Testdatei wurde nicht gefunden!"
Exit Sub
End If
Set wks = ActiveSheet
Workbooks.Open Filename:=sfile
Worksheets("ADB").Select
iRowS = wks.Cells(Rows.Count, 1).End(xlUp).Row
If IsEmpty(Range("A1")) Then
iRow = 1
Else
iRow = wks.Cells(Rows.Count, 2).End(xlUp).Row + 1
End If
wks.Rows(iRowS).copy Rows(iRow)
ActiveWorkbook.Close savechanges:=True
Application.ScreenUpdating = False
End Sub