@Dianka05
Всегда на позитиве :Р

Светлофор в excel, как сделать задержку?

Я делаю светофор в экселе, и не знаю как правильно сделать задержку, типа когда включаю чтобы сперва шел червоный потом ждет потом желтий и свона ждет атд.

Sub Prodleva()

  Dim Delka As Single
  Delka = 1.3
  Dim bunka As Range
  Set bunka = ActiveCell
  

Dim Kon As Single

Kon = timer + Delka

bunka(1, 1).Interior.ColorIndex = 9
bunka(2, 1).Interior.ColorIndex = 44
bunka(3, 1).Interior.ColorIndex = 10

    
Do While timer < Kon
  If Cells.FillUp Then
         bunka(1, 1).Interior.ColorIndex = 3
        
            If Cells.FillUp Then
                bunka(2, 1).Interior.ColorIndex = 6
               
                   If Cells.FillUp Then
                      bunka(3, 1).Interior.ColorIndex = 4
                      bunka(1, 1).Interior.ColorIndex = 9
                      bunka(2, 1).Interior.ColorIndex = 44
                      bunka(3, 1).Interior.ColorIndex = 10
                     
                     
                        If Cells.FillUp Then
                          bunka(3, 1).Interior.ColorIndex = 4
                         
                            If Cells.FillUp Then
                              bunka(2, 1).Interior.ColorIndex = 6
                             
                                 If Cells.FillUp Then
                                    bunka(1, 1).Interior.ColorIndex = 3
                                  
                                      If Cells.FillUp Then
                                         bunka(1, 1).Interior.ColorIndex = 9
                                         bunka(2, 1).Interior.ColorIndex = 44
                                         bunka(3, 1).Interior.ColorIndex = 10
                                      End If
                                End If
                           End If
                     End If
                   End If
           End If
  End If
        
Loop

End Sub
  • Вопрос задан
  • 82 просмотра
Решения вопроса 1
idShura
@idShura
Application.Wait Now + #0:00:05#
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы