2013-04-19 4 views
0

특정 셀의 시트에 타이머가 있습니다. 시트에 프리셋 된 값 (매크로 또는 셀 참조 중 하나)을 채우고 데모 용 템플 릿을 입력해야합니다. 아무도 이것을 한 적이 없습니까? 내 코드는 .. "예"하위는 완료되지 않았지만 한 조각을 작동시키고 싶었습니다. 나는 할 수 없다.excel 프레젠테이션 용 타이머에 시트에 데이터를 입력하십시오.

Sub timer() 
Application.OnTime Now + TimeValue("00:00:01"), "Increment_count" 
End Sub 
Sub Increment_Count() 
Range("AE5").Value = Range("AE5") + TimeValue("00:00:01") 
timer 

Application.Run ("yeah") 

End Sub 
Sub STOPtimer() 
Application.OnTime Now + TimeValue("00:00:01"), "Increment_count", Schedule:=False 
End Sub 

Sub yeah() 

Dim i As Integer 

For i = 2 To 31 
If IsError(Cells(i, 39)) = False And IsError(Cells(32, 5)) = False Then 
If Cells(i, 38) = Cells(31, 5) Then 
Cells(1, 8) = Cells(i, 39) 
End If 
End If 

Next i 

End Sub 
+1

정확하게 작동하지 않는 것은 무엇입니까 ?? 내가 네가 매 초마다 뛰길 바래? 나는 모든 잠수함을 하나로 결합 할 수 있다고 생각합니다 ... –

+0

12:00:10 (10 초)에 주어진 셀을 채울 필요가 있으므로 예를 들어 초마다 실행해야합니다. –

+0

죄송합니다, 다시, 정확히 어디에 문제가 있습니까 ?? 무엇이 작동하지 않는가 ?? 그것은 멈춘다, 또는, 무엇? 이 줄'Cells (1, 8) = Cells (i, 39)'가 실행되는지 확신합니까 ?? 이 방법으로 그것을 확인할 수 있습니다 - 거기에 커서를 놓고 F9를 누르고 메인 서브를 다음으로 실행하십시오. 거기서 멈 추면 복사 할 데이터가 있는지 확인하십시오 ... –

답변

0

데이터가 천천히 채워지는 경막 외 유형 효과가 있습니까? 나는 그것이 당신이하는 일이라고 생각합니다. 타이머는 다소 시간이 걸리는 무언가에 대해서는 불필요한 것처럼 보입니다. (30 또는 그 수가 적지 않습니다.)

Declare Sub Sleep Lib "kernel32" _ 
(ByVal dwMilliseconds As Long) 


Sub Macro1() 

    Range("B1").Value = "1" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B2").Value = "2" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B3").Value = "3" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B4").Value = "4" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B5").Value = "5" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B6").Value = "6" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B7").Value = "7" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B8").Value = "8" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B9").Value = "9" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B10").Value = "10" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B11").Value = "11" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B12").Value = "12" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B13").Value = "13" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B14").Value = "14" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B15").Value = "15" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B16").Value = "16" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B17").Value = "17" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B18").Value = "18" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B19").Value = "19" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B20").Value = "20" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B21").Value = "21" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B22").Value = "22" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B23").Value = "23" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B24").Value = "24" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B25").Value = "25" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B26").Value = "26" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B27").Value = "27" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B28").Value = "28" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B29").Value = "29" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B30").Value = "30" 
    Sleep 1000 'Implements a 1 second delay 
    Range("B31").Value = "31" 

End Sub 

이 방법을 사용하면 원하는 효과를 적용하여 그룹을 채우고 효과를 지연시킬 수 있습니다. 비록 개인적으로 프리젠 테이션 목적을 위해 - 나는 단지 데이터를 표시하고 그것으로 끝낼 것입니다. 이 점에서 관중들을 놀라게 할 필요는 없습니다. 그래도 내 부분에 개인적인 취향. 행운을 빕니다.

관련 문제