AW: Noch offen...
12.08.2004 09:40:22
Andreas
Hi,
hier mal das was ich vor habe. Läuft leider nicht...
Sub Code_einfügen()
'Dim CP As Object
' CodePane für Tabelle2 finden
'For Each CP In Application.VBE.CodePanes
'If CP.codemodule.Name = "Tabelle2" Then
'Set Application.VBE.ActiveCodePane = CP
'End If
'Next
' Code einfügen
On Error Resume Next
With Application.VBE.ActiveCodePane.codemodule
.InsertLines .countoflines + 1, "
Private Sub CommandButton1_Click()"
.InsertLines .countoflines + 1, "Leere_Zellen_loeschen"
.InsertLines .countoflines + 1, "End Sub
"
.InsertLines .countoflines + 1, ""
.InsertLines .countoflines + 1, "
Private Sub Worksheet_Calculate()"
.InsertLines .countoflines + 1, "activesheet.Cells(activesheet.Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = [l5]"
.InsertLines .countoflines + 1, "activesheet.Cells(activesheet.Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = [m5]"
.InsertLines .countoflines + 1, "activesheet.Cells(activesheet.Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = [n5]"
.InsertLines .countoflines + 1, "activesheet.Cells(activesheet.Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = [o5]"
.InsertLines .countoflines + 1, "activesheet.Cells(activesheet.Cells(Rows.Count, 16).End(xlUp).Row + 1, 16) = [p5]"
.InsertLines .countoflines + 1, "activesheet.Cells(activesheet.Cells(Rows.Count, 17).End(xlUp).Row + 1, 17) = [q5]"
.InsertLines .countoflines + 1, "End Sub
"
.InsertLines .countoflines + 1, ""
.InsertLines .countoflines + 1, "
Private Sub Worksheet_activate()"
.InsertLines .countoflines + 1, "Doppelt"
.InsertLines .countoflines + 1, "End Sub
"
End With
End Sub
Wer kann helfen?
Gruß Andreas