AW: Einfärben
16.08.2006 17:13:26
mike49
Sorry Eule,
komme leider immer noch nicht klar, da ich bei Makros nicht so gut bin.Ich habe dein Makro so abgeändert und in das Arbeitsblatt geschrieben. Aber irgenwie mache ich was falsch. Könntest du mir nochmals behilflich sein?
Private Sub Worksheet1_Change(ByVal Target As Range)
Dim zahl
Dim ll As Integer
If Target.Count > 1 Then Exit Sub
If Target = Cells(24, 16) Then
With Cells(31, 2) 'hier musst du anpassen (deine Ausgabezelle)
zahl = Format(Abs(Cells(24, 16)), "#,###.#0 ")
ll = Len(zahl)
.Value = "=Die Nachzahlung von "&TEXT(P24;"#.##0,00 ;[Rot]#.##0,00 ") &" bitte auf das Konto 8140782700 bei der BW-Bank Heilbronn (BLZ 620 300 50) überweisen."
.Characters(Start:=1, Length:=4).Font.ColorIndex = xlAutomatic
.Characters(Start:=4, Length:=12).Font.ColorIndex = 3
.Characters(Start:=16, Length:=5).Font.ColorIndex = xlAutomatic
.Characters(Start:=21, Length:=ll).Font.ColorIndex = 3
.Characters(Start:=21 + ll, Length:=12).Font.ColorIndex = xlAutomatic
End With
With Range("B31:P31")
.HorizontalAlignment = xlCenterAcrossSelection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End If
End Sub
Gruß
mike49