21.02.2016, 14:36
(Dieser Beitrag wurde zuletzt bearbeitet: 21.02.2016, 14:37 von jeroenpunt14.)
Könnt ihr mir sagen warum den Code in der angehängten Datei nicht funktioniert?
Danke!
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Range("C1", Cells(1, Cells(1, Columns.Count).End(xlToLeft).Column)), Target) Is Nothing Then
FilterColumn
End If
End Sub
Sub FilterColumn()
Dim hide As Boolean
If Cells(1, 1).Interior.ColorIndex <> 46 Then hide = True
If hide Then
Range(Cells(ActiveCell.Row, 3), Cells(ActiveCell.Row, Columns.Count)). _
RowDifferences(Comparison:=ActiveCell).EntireColumn.Hidden = True
Cells(ActiveCell.Row, 1).Interior.ColorIndex = 46
Else
Columns.Hidden = False
Columns(1).Interior.ColorIndex = xlNone
End If
Cells(1, 1).Select
End Sub
Danke!
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Range("C1", Cells(1, Cells(1, Columns.Count).End(xlToLeft).Column)), Target) Is Nothing Then
FilterColumn
End If
End Sub
Sub FilterColumn()
Dim hide As Boolean
If Cells(1, 1).Interior.ColorIndex <> 46 Then hide = True
If hide Then
Range(Cells(ActiveCell.Row, 3), Cells(ActiveCell.Row, Columns.Count)). _
RowDifferences(Comparison:=ActiveCell).EntireColumn.Hidden = True
Cells(ActiveCell.Row, 1).Interior.ColorIndex = 46
Else
Columns.Hidden = False
Columns(1).Interior.ColorIndex = xlNone
End If
Cells(1, 1).Select
End Sub