1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
| Sub BECKBLA()
Dim MyTime
MyTime = #8:36:00 PM#
With Worksheets(1).Range("A1:A47")
Set c = .Find("BECKBLA", LookIn:=xlValues)
If Not c Is Nothing Then
Range(c.Address).Select
Do While ActiveCell.Value <> ""
If Time <= MyTime Then
If ActiveCell.Value = "13" Then
ActiveCell.Offset(rowOffset:=1, columnOffset:=-12).Activate
Else
ActiveCell.Next.Select
End If
Else
If ActiveCell.Value = "27" Then
ActiveCell.Offset(rowOffset:=1, columnOffset:=-12).Activate
Else
ActiveCell.Offset(rowOffset:=0, columnOffset:=15).Activate
End If
End If
Loop
Else
'MyTime = #9:36:00 PM#
If Time <= MyTime Then
With Worksheets(1).Range("C1:C47")
Set c = .Find("", LookIn:=xlValues)
If Not c Is Nothing Then
Range(c.Address).Select
ActiveCell.Offset(rowOffset:=0, columnOffset:=-2).Activate
If ActiveCell.Value = "TREBOS" Then
ActiveCell.Offset(rowOffset:=2, columnOffset:=0).Activate
ActiveCell.Value = "BECKBLA"
ActiveCell.Offset(rowOffset:=0, columnOffset:=2).Activate
Else
ActiveCell.Value = "BECKBLA"
End If
Do While ActiveCell.Value <> ""
If Time <= MyTime Then
If ActiveCell.Value = "13" Then
ActiveCell.Offset(rowOffset:=1, columnOffset:=-12).Activate
Else
ActiveCell.Next.Select
End If
Else
If ActiveCell.Value = "27" Then
ActiveCell.Offset(rowOffset:=1, columnOffset:=-12).Activate
Else
ActiveCell.Offset(rowOffset:=0, columnOffset:=15).Activate
End If
End If
Loop
End If
End With
Else
With Worksheets(1).Range("P1:P47")
Set c = .Find("", LookIn:=xlValues)
If Not c Is Nothing Then
Range(c.Address).Select
ActiveCell.Offset(rowOffset:=0, columnOffset:=-2).Activate
ActiveCell.Value = "BECKBLA"
Do While ActiveCell.Value <> ""
If Time <= MyTime Then
If ActiveCell.Value = "13" Then
ActiveCell.Offset(rowOffset:=1, columnOffset:=-12).Activate
Else
ActiveCell.Next.Select
End If
Else
If ActiveCell.Value = "27" Then
ActiveCell.Offset(rowOffset:=1, columnOffset:=-12).Activate
Else
ActiveCell.Offset(rowOffset:=0, columnOffset:=15).Activate
End If
End If
Loop
End If
End With
End If
End If
End With
End Sub |
Partager