wie kann ich bedingte Formatierungen vor Copy and Paste/ Drag&Drop schützen?
Option Explicit
Public rng, rng2(50)
Das kommt ins zu schützende blatt:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim n
For n = 1 To rng.FormatConditions.Count
If Not Intersect(Target, rng2(n)) Is Nothing Then
With rng.FormatConditions(n)
.ModifyAppliesToRange (rng2(n))
End With
End If
Next n
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim n, x
Set rng = Range(Cells(1, 1), Cells(1000, 1000))
x = rng.FormatConditions.Count
For n = 1 To x
With rng.FormatConditions(n)
Set rng2(n) = .AppliesTo
End With
Next n
End Sub
Public rng, rng2(20, 10)
Das in jedes zu schützende blatt:Private Sub Worksheet_Change(ByVal Target As Range)
Dim n, i
i = ActiveSheet.Index
For n = 1 To rng.FormatConditions.Count
If Not Intersect(Target, rng2(i, n)) Is Nothing Then
With rng.FormatConditions(n)
.ModifyAppliesToRange (rng2(i, n))
End With
End If
Next n
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim n, x, i
i = ActiveSheet.Index
Set rng = Range(Cells(1, 1), Cells(1000, 1000))
x = rng.FormatConditions.Count
For n = 1 To x
With rng.FormatConditions(n)
Set rng2(i, n) = .AppliesTo
End With
Next n
End Sub