von Mappe1 Wert nach Mappe2
26.03.2014 19:00:53
Mappe1
es funktioniert aber nur wenn ich den Makro in Mappe2 schreibe aber wenn es in Mappe1 dann funktioniert nicht. Haber vieles versucht aber funktioniert nicht?
Frage was muß ich ändern wenn ich den Makro von Mappe1 starte und in Mappe2 einfügen soll?
Sub Versuch ()
Dim lngMaxRow&
Dim objExMappe As Workbook
Dim strQuelleDatei$
'Quelle anpassen
strQuelleDatei = "Mappe1.xls"
With Tabelle1 'wo Daten hin sollen
lngMaxRow = .Cells(.Rows.Count, 1).End(xlUp).Row + 1 'letzte Zeile +1
For Each objExMappe In Application.Workbooks 'Suche Quelle
If objExMappe.Name = strQuelleDatei Then
objExMappe.Activate 'aktivieren
ActiveWindow.Selection.EntireRow.Copy .Cells(lngMaxRow, 1) 'kopieren
ThisWorkbook.Activate 'Diese Datei aktivieren
Exit For 'ende Schleife
End If
Next objExMappe 'nächte
End With
End Sub