AW: Doch noch eine Frage an Beverly
17.09.2008 14:23:49
Beverly
Hi Thorsten,
Private Sub CommandButton1_Click()
Dim loZeile As Long
Dim lozeile2 As Long
Dim raZelle As Range
Dim raSelektion As Range
On Error Resume Next
loZeile = Application.Match(CDbl(DateValue(TextBox1)), ActiveSheet.Columns(1), 0)
lozeile2 = Application.Match(CDbl(DateValue(TextBox2)), ActiveSheet.Columns(1), 0)
If Err > 0 Then
MsgBox "Datum nicht gefunden"
Else
Set raZelle = Rows(7).Find(ComboBox1, lookat:=xlWhole)
For Each raZelle In Range(Cells(loZeile, raZelle.Column), Cells(lozeile2, raZelle.Column)) _
If Weekday(Cells(raZelle.Row, 1), vbMonday) 7 Then
If raSelektion Is Nothing Then
Set raSelektion = raZelle
Else
Set raSelektion = Union(raSelektion, raZelle)
End If
End If
Next raZelle
Application.Goto reference:=raSelektion, Scroll:=True
End If
On Error GoTo 0
Err.Clear
End Sub