Code Snippet "VBA Excel"
Alle Datumswerte in einer Markierung um 365 Tage nach vorne schieben
Achtung: Dieser Makro überschreibt Formeln!
Sub DatumAendern()
For Each objCell In Selection
'MsgBox (objCell.NumberFormat)
If objCell.NumberFormatLocal = "TT.MM.JJ" _
Or objCell.NumberFormatLocal = "TT.MM.JJJJ" _
Or objCell.NumberFormatLocal = "T.M.JJ"
Or objCell.NumberFormatLocal = "T.M.JJJJ" Then
If objCell.Value <> "" Then
objCell.Value = objCell.Value - 365
End If
End If
Next
End Sub