AW: Inhalte mit Farbe übertragen
07.12.2011 07:30:17
fcs
Hallo Karsten,
so sollte es funktionieren.
Gruß
Franz
Sub a()
Dim Erg As String
Dim Erg1 As String
Dim sp As Long
Dim ze As Long
Dim sh1 As Worksheet, sh2 As Worksheet
Dim Zelle As Range
Dim i As Long
Set sh1 = Sheets("Tabelle1")
Set sh2 = Sheets("Tabelle2")
sh2.Cells.Clear
For sp = 4 To sh1.UsedRange.Columns.Count
sh2.Cells(sp, 1).Value = sh1.Cells(1, sp)
Erg = ""
For Each Zelle In Range(sh1.Cells(2, sp), sh1.Cells(Rows.Count, sp).End(xlUp))
'If IsNull(Zelle.Font.ColorIndex) Then
Erg1 = ""
For i = 1 To Len(Zelle.Value)
If Zelle.Characters(i, 1).Font.ColorIndex = 3 Then
Erg1 = Erg1 & Mid(Zelle.Value, i, 1)
End If
Next
If Erg1 "" Then Erg = Erg & Erg1 & ", "
'End If
Next
If Erg "" Then sh2.Cells(sp, 2).Value = Left(Erg, Len(Erg) - 2)
Next
Sheets("Tabelle2").Select
End Sub