AW: Werte in Zellen überschreiben
05.11.2009 22:04:42
Josef
Hallo Friedhelm,
kopiere die Codeteile in die entsprechenden Module, die Formate musst du halt anpassen.
' **********************************************************************
' Modul: Tabelle1 Typ: Element der Mappe(Sheet, Workbook, ...)
' **********************************************************************
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
On Error GoTo ErrExit
If Not Intersect(Target, Range(cstrRange)) Is Nothing Then
Application.EnableEvents = False
For Each rng In Intersect(Target, Range(cstrRange))
rng.Font.Italic = False
rng.Font.ColorIndex = xlAutomatic
Next
End If
ErrExit:
Application.EnableEvents = True
End Sub
' **********************************************************************
' Modul: Tabelle2 Typ: Element der Mappe(Sheet, Workbook, ...)
' **********************************************************************
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
On Error GoTo ErrExit
If Not Intersect(Target, Range(cstrRange)) Is Nothing Then
Application.EnableEvents = False
For Each rng In Intersect(Target, Range(cstrRange))
With Sheets("Tabelle1").Range(rng.Address)
.Font.Italic = True
.Font.ColorIndex = 3
.Value = rng.Value
End With
Next
End If
ErrExit:
Application.EnableEvents = True
End Sub
' **********************************************************************
' Modul: Modul1 Typ: Allgemeines Modul
' **********************************************************************
Option Explicit
Public Const cstrRange As String = "A5:J30"
Gruß Sepp