ich möchte aus der XLS Datei 1 beim Ausführen des Makros 1 den folgenden Quelltext in eine vom MAkro 1 erzeugte Datei schreiben.
Option Explicit
Public rngPrev As Range
Public varIC As Variant
Public varFC As Variant
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Application.EnableEvents = False
If Not rngPrev Is Nothing Then
rngPrev.Interior.ColorIndex = varIC
rngPrev.Font.ColorIndex = varFC
End If
Set rngPrev = Target
With Target(1)
varIC = .Interior.ColorIndex
varFC = .Font.ColorIndex
.Interior.ColorIndex = _
IIf(varFC = xlColorIndexAutomatic, 1, varFC)
.Font.ColorIndex = _
IIf(varIC = xlColorIndexNone, 2, varIC)
End With
Application.EnableEvents = True
End Sub
Wie kann ich das machen?
Danke für die Hilfe