View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Patrick Dave Patrick is offline
external usenet poster
 
Posts: 249
Default time interval other than forms

Try something like this.

Dim mytime As Date
Dim mydelay As Single
Dim mymilliseconds As Single
mymilliseconds = 500
If mymilliseconds 0 Then
mydelay = mymilliseconds / 86400000
Else
Exit Sub
End If
mytime = Now()
Do While Now() < mytime + mydelay
DoEvents
Loop


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"JLGWhiz" wrote:
| Here is the code I currently use:
|
| Sub WaitTime()
| newHour = Hour(Now())
| newMinute = Minute(Now())
| newSecond = Second(Now()) + 1
| sitTime = TimeSerial(newHour, newMinute, newSecond)
| Application.Wait sitTime
| End Sub
|
| Sub TestShape()
| Set myDocument = Worksheets(4)
| myDocument.Shapes.AddShape msoShape32pointStar, 250, 250, 100, 200
| myDocument.Shapes(1).Fill.ForeColor.RGB = RGB(255, 100, 100)
| Set newWordArt =
| myDocument.Shapes.AddTextEffect(PresetTextEffect:= msoTextEffect1,
| Text:="Test", fontName:="Arial Black", fontSize:=36, FontBold:=msoFalse,
| FontItalic:=msoFalse, Left:=10, Top:=10)
| Counter = 0
| Do
| With myDocument.Shapes(1)
| .IncrementLeft Counter + 70
| .IncrementTop (Counter * -1) + (-50)
| .IncrementRotation 30
| End With
| Counter = Counter + 25
| WaitTime
| Loop While Counter < 100
| Worksheets(4).Shapes(1).Delete
| Worksheets(4).Shapes(2).Delete
| End Sub
|
| As you can see, one second is the least time interval I can get because of
| the time serial limitation. I would like to cut the time interval to a
half
| second. Is there code for this without using a form?