AW: sorry, doppelt durch Serverproblem! o.T.
01.03.2009 14:45:05
Josef
Hallo Karsten,
dann nimm diesen Code.
' **********************************************************************
' Modul: Modul1 Typ: Allgemeines Modul
' **********************************************************************
Option Explicit
Sub nextAppointment()
Dim lngDay As Long, lngCol As Long, lngRow As Long, strRng As String, dblTime As Double
lngDay = Weekday(Date, vbMonday)
If lngDay > 5 Then lngDay = 1
lngCol = (lngDay - 1) * 3 + 1
On Error GoTo ErrExit
With ActiveSheet
If lngDay <> Weekday(Date, vbMonday) Then
lngRow = 3
Else
strRng = .Range(.Cells(1, lngCol), .Cells(50, lngCol)).Address
dblTime = Evaluate("MAX(IF((" & strRng & "<=(NOW()-INT(NOW())))*(" & strRng & "<>0)," & strRng & "))")
lngRow = Application.Match(dblTime, .Range(strRng), 0)
End If
Application.Goto .Cells(lngRow, lngCol)
End With
ErrExit:
End Sub
Gruß Sepp