Bonjour a tous , mon petit probleme le voici, dans m'as procedure si il est 10h30 alors la cellule active est en "C" si il est plus de 10h30 alors vas en "P" cela fonctionnais et maintenent plus rien il reste toujour en "C" puis suivant puisque je fais un tab a chaque fois que j'ai ecrit quelque chose .

est-ce que quelqu'un pourrais me dire se qui manque , merci d'avance

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Sub BECKBLA()
 Dim MyTime
MyTime = #10:30:00 AM#
    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 Left(ActiveCell.Address, 2) = "$O" Then
                    If ActiveCell.Offset(rowOffset:=1, columnOffset:=-12).Value = "14" Then
                        ActiveCell.Offset(rowOffset:=1, columnOffset:=-12).Activate
                    Else
                        Rows(Right(ActiveCell.Address, 1) + 1 & ":" & Right(ActiveCell.Address, 1) + 1).Select
                        Selection.Insert Shift:=xlDown
                        ActiveCell.Next.Select
                        ActiveCell.Next.Select
                    End If
                Else
                    ActiveCell.Next.Select
                End If
            Else
                If Left(ActiveCell.Address, 2) = "$P" Or Left(ActiveCell.Address, 3) = "$AB" Then
 
                    If ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Value = "1" Or ActiveCell.Offset(rowOffset:=1, columnOffset:=-12).Value >= "26" Then
                        ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate
                    Else
                        Rows(Right(ActiveCell.Address, 1) + 1 & ":" & Right(ActiveCell.Address, 1) + 1).Select
                        Selection.Insert Shift:=xlDown
                        ActiveCell.Offset(rowOffset:=0, columnOffset:=14).Activate
                        ActiveCell.Next.Select
                    End If
                Else
                    ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Activate
                End If
            End If
 
        Loop
 
    Else
        With Worksheets(1).Range("A1:A47")
            Set c = .Find("", LookIn:=xlValues)
            If Not c Is Nothing Then
                Range(c.Address).Select
                ActiveCell.Value = "BECKBLA"
                ActiveCell.Next.Select
                If ActiveCell.Offset(rowOffset:=-1, columnOffset:=0).Value = "Prépa" Then
                    ActiveCell.FormulaR1C1 = Range("b2") + 1
                    ActiveCell.Next.Select
                Else
                    ActiveCell.FormulaR1C1 = ActiveCell.Offset(rowOffset:=-1, columnOffset:=0).Value + 1
                    ActiveCell.Next.Select
                End If
            End If
        End With
    End If
 
    End With
 
End Sub