Hallo,
verdammte Html_Killer...
Hier mal ein Ansatz ohne Schleife:
Option Explicit
Public Sub test()
Const ROWTO_CHECK As Long = 1
Const CHECK_VAL As Long = 1
Const STOP_CHECK As Long = 0
Dim objRange As Range
With ActiveSheet
On Error Resume Next
Set objRange = .Range(.Cells(ROWTO_CHECK, Application.Match(CHECK_VAL, Rows(ROWTO_CHECK), 0)), _
.Cells(ROWTO_CHECK, .Cells(ROWTO_CHECK, .Columns.Count).End(xlToLeft).Column)).Find( _
What:=STOP_CHECK, LookIn:=xlValues, LookAt:=xlWhole)
If Err Then MsgBox "Suchwert nicht gefunden", vbExclamation, "NotFound": Exit Sub
On Error GoTo 0
If Not objRange Is Nothing Then _
.Range(.Cells(objRange.Row, Application.Match(CHECK_VAL, Rows(ROWTO_CHECK), 0)), _
.Cells(objRange.Row, objRange.Column - 1)).Columns.Hidden = True
End With
Set objRange = Nothing
End Sub
Voraussetzung: Es kommen nur 0 und 1 vor.....
Gruß,
|