AW: Bestimmte Werte ins Negativ setzen
26.01.2010 14:24:27
fcs
Hallo Sascha,
zum Beispiel so
Gruß
Franz
Sub InvertSpalteG()
Dim Zeile As Long
Dim wks As Worksheet
Set wks = ActiveSheet
Application.ScreenUpdating = False
With wks
'Zeilen Spalte B bis letzte Zeile mit Daten bearbeiten
For Zeile = 1 To .Cells(.Rows.Count, 2).End(xlUp).Row
If Left(.Cells(Zeile, 2), 3) = "GUT" Or Left(.Cells(Zeile, 2), 2) = "AV" Then
'In Spalte G Wert invertieren
If IsNumeric(.Cells(Zeile, 7).Value) Then
.Cells(Zeile, 7).Value = .Cells(Zeile, 7).Value * (-1)
End If
End If
Next
End With
Application.ScreenUpdating = True
End Sub