Mit VBA - Worksheet_Change Ereignis füllen
24.10.2003 10:19:43
Andi_H
ich brauche mal wieder hilfe.
mit folgendem Code füge ich meiner Mappe ein neues sheet hinzu:
Private Sub cbNeuerMa_Click()
Dim str As String
If frmMAneu.txtfunktion = "" Or frmMAneu.txtfunktion = " " Or _
frmMAneu.txtName = "" Or frmMAneu.txtName = " " Then
MsgBox ("Fehlerhafte Eingabe, bitte wiederholen")
Exit Sub
End If
str = frmMAneu.txtfunktion & " " & frmMAneu.txtName.Text
Sheets.Add
With ActiveSheet
.Name = str
End With
frmMAneu.txtfunktion = ""
frmMAneu.txtName.Text = ""
End Sub
nun möchte ich in das neu erstellte sheet folgenden Code in Worksheet_Change ereignis schreiben, weiß aber leider nicht wie das geht. Kann mir da jemadn helfen? Vielen Dank schon mal.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim i, xSum As Integer
If Target = "" Then Exit Sub
If Target.Row > 10 And Target.Row < 23 And Target.Column > 2 And Target.Column < 34 Then
For i = 3 To 33
Sum = Sum + Cells(Target.Row, i)
Next
Cells(Target.Row, 34) = Sum
Sum = 0
End If
End Sub
Gruß
Andi