fangen wir einfach mal an...
01.07.2009 09:03:27
Tino
Hallo,
wenn in Mappe2 das gleiche stehen soll wie in Mappe1,
kopiere die Daten einfach in die Tabelle der Mappe2.
Oder mach es einfach beim speichern, aus Mappe1 heraus.
z. Bsp. so, kommt in die Mappe1.
kommt als Code in DieseArbeitsmappe
Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim objMappe2 As Workbook
Dim booOffen As Boolean
Dim iCalc As Integer
With Application
iCalc = .Calculation
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
On Error Resume Next
Set objMappe2 = Workbooks("Mappe2.xls") 'Name der Mappe zwei anpassen
On Error GoTo 0
If objMappe2 Is Nothing Then
'Pfad zur Mappe2 anpassen
Set objMappe2 = Workbooks.Open("E:\1 Forum\TestOrdner\Mappe2.xls")
Else
booOffen = True
End If
ThisWorkbook.Sheets("Tabelle1").Cells.Copy objMappe2.Sheets("Tabelle1").Cells
objMappe2.Save
'Mappe2 schließen, wenn diese zuvor geschlossen war
If Not booOffen Then objMappe2.Close False
.Calculation = iCalc
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Das mit Deiner Mappe3 verstehe ich immer noch nicht!
Mappe3 ändert sich doch nicht von selbst?
Gruß Tino