0

I have a working timer in my sheet in a certain cell. I need to populate the sheet with predetmined values (in the macro or references to cell either one) and input the into a templete for a demonstration. Has anyone ever done this. My code is.. The "yeah" sub is NOT done but I wanted to get one piece working. I cannot.

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
4

1 回答 1

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

通过这种方式,您可以根据需要填充组并更改效果之间的延迟。虽然个人出于演示目的 - 我只会显示数据并完成它。在这方面无需让观众惊叹。不过,这只是我个人的喜好。祝你好运。

于 2013-04-19T20:10:37.173 回答