ich möchte ein Makro erweitern und zwar...
In aktiven Arbeitsblatt möchte ich die Inhalte in Spalte D (ab Zeile 2 bis 5000) mit Zahl 4 multiplizieren.
Wie mache ich das ?
Danke im Voraus...
Gruß
Selma
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("D2:D5000")) Is Nothing Then
Application.EnableEvents = False
On Error GoTo ende
Target = Target * 4
End If
ende:
Application.EnableEvents = True
End Sub
Sub ZahlMal4()
Dim Ze As Integer
For Ze = 2 To 5000
If Cells(Ze, 4) = "" Then Exit For ' Abbruch wenn 1. Leere Zelle ereicht.
If Cells(Ze, 4) <> "" Then ' Keine leeren Cellen bearbeiten
Cells(Ze, 4) = Cells(Ze, 4) * 4
End If
' Bei Textcellen allerdings -Abbruch- durch Fehler, Text mal 4 geht nicht.
Next Ze
End Sub