Also zum Beispiel in A1 ist ein Eingabefeld. Ich gebe zB 120 ein. In B1 soll dann 120 stehen. Anschließend gebe ich in A1 346 ein → nun soll in B2 346 stehen. Und so weiter.
freu mich über eure Antworten
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.EnableEvents = False
Target.Offset(0, 1) = Target.Offset(0, 1) + Target
Application.EnableEvents = True
End If
End Sub
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.EnableEvents = False
If Target.Offset(0, 1) = "" Then
Target.Offset(0, 1) = Target
Else
Target.Offset(0, 1) = Target.Offset(0, 1) & vbLf & Target
End If
Application.EnableEvents = True
End If
End Sub
Gruß HajoOption Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Loletzte&
Loletzte = Cells(Rows.Count, 2).End(xlUp).Row
If Target.Address = Cells(1, 1).Address Then
If Cells(1, 2) = "" Then
Cells(1, 2) = Target
Else
Cells(Loletzte + 1, 2) = Target
End If
End If
End Sub
Code gehört in die entsprechende TabelleOption Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Loletzte As Long
If Target.Address(0, 0) = "A1" Then
Loletzte = Cells(Rows.Count, 2).End(xlUp).Offset(1).Row
If Cells(1, 2) = "" Then Loletzte = 1
Cells(Loletzte, 2) = Target
End If
End Sub
Public Sub aaa()
Application.EnableEvents = True
End Sub
Jetzt nochmal was in A1 eingeben.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Loletzte&
Loletzte = Cells(Rows.Count, 2).End(xlUp).Row
If Target.Address = Cells(4, 5).Address Then
If Cells(1, 2) = "" Then
Cells(1, 2) = Target
Else
Cells(Loletzte + 1, 2) = Target
End If
End If
End Sub
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Loletzte As Long
If Target.Address(0, 0) = "E4" Then
With Worksheets("Tabelle2")
Loletzte = .Cells(.Rows.Count, 1).End(xlUp).Offset(1).Row
If .Cells(1, 1) = "" Then Loletzte = 1
.Cells(Loletzte, 1) = Target
End With
End If
End Sub
Der Code gehört ins Codemodul von deiner Tabelle1.Private Sub Worksheet_Change(ByVal Target As Range)
Dim Loletzte&
Loletzte = Cells(Rows.Count, 6).End(xlUp).Row
If Target.Address = Cells(4, 5).Address Then
If Cells(4, 6) = "" Then
Cells(4, 6) = Target
Else
Cells(Loletzte + 1, 6) = Target
End If
End If
End Sub
Du musst also immer nur Zeile und Spalte anpassen bei Benutzung von Cells()Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address "$E$4" Or Target.Value = "" Then Exit Sub
With Worksheets("Tabelle2")
.Cells(IIf(IsEmpty(.Cells(1, 1)), 1, IIf(IsEmpty(.Cells(2, 1)), 2, _
.Cells(1, 1).End(xlDown).Row + 1)), 1) = Target.Value
End With
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Const x As Long = 4
Const y As Long = 10
If Target.Address "$E$4" Or Target.Value = "" Then Exit Sub
With Worksheets("Tabelle2")
.Cells(IIf(IsEmpty(.Cells(x, y)), x, IIf(IsEmpty(.Cells(x + 1, y)), x + 1, _
.Cells(x, y).End(xlDown).Row + 1)), y) = Target.Value
End With
End Sub