Replace Selection durch 0

  • Excel

    Replace Selection durch 0

    Hi,

    folgendes Problem für mich als Anfänger.
    Ich markiere mir ein paar Zellen in roter Schrift.
    Hilfreich wäre wenn ich mir diese aber anstatt rot zu markieren,
    lieber als 0 ersetzen würde, damit diese nicht mit berechnet werden.
    Wie stelle ich das an? Vorab Danke für eure Hilfe.

    Gruß




    Visual Basic-Quellcode

    1. Sub Blabla()
    2. '
    3. ' Blabla Makro
    4. '
    5. '
    6. Columns("A:N").Select
    7. Selection.ClearContents
    8. Selection.ColumnWidth = 0
    9. Columns("P:P").Select
    10. Selection.ClearContents
    11. Columns("R:AT").Select
    12. Selection.ClearContents
    13. Range("O:O,Q:Q").Select
    14. Range("Q1").Activate
    15. Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
    16. "=$O1:$O800<$Q1:$Q800"
    17. Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    18. With Selection.FormatConditions(1).Font
    19. .Bold = True
    20. .Italic = False
    21. .Color = -16776961
    22. .TintAndShade = 0
    23. End With
    24. Selection.FormatConditions(1).StopIfTrue = False
    25. Range("O1").Select
    26. ActiveCell.FormulaR1C1 = "=SUM(R[2]C:R[799]C)/100"
    27. Range("Q1").Select
    28. ActiveCell.FormulaR1C1 = "=SUM(R[2]C:R[868]C)/100"
    29. Range("U1").Select
    30. ActiveCell.FormulaR1C1 = "=SUM(RC[-6]-RC[-4])"
    31. ActiveCell.FormulaR1C1 = "=SUM(RC[-6]-RC[-4])"
    32. Range("U1").Select
    33. Selection.NumberFormat = "0.00"
    34. With Selection.Font
    35. .Name = "Calibri"
    36. .FontStyle = "Fett"
    37. .Size = 22
    38. .Strikethrough = False
    39. .Superscript = False
    40. .Subscript = False
    41. .OutlineFont = False
    42. .Shadow = False
    43. .Underline = xlUnderlineStyleNone
    44. .ThemeColor = xlThemeColorDark1
    45. .TintAndShade = 0
    46. .ThemeFont = xlThemeFontMinor
    47. End With
    48. With Selection.Interior
    49. .Pattern = xlSolid
    50. .PatternColorIndex = xlAutomatic
    51. .Color = 12611584
    52. .TintAndShade = 0
    53. .PatternTintAndShade = 0
    54. End With
    55. Range("U1").Select
    56. End Sub


    *Topic verschoben, BBCode eingefügt*

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Marcus Gräfe“ ()