Help With A Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get this macro to run but am having trouble:

Public nTime

Sub xx()

nTime = Now + Time(0, 0, 5) ' 5 secs
Application.OnTime nTime, "temp"

End Sub


Sub temp()
Dim iLastRow As Long

Range(Range("C2"), Range("C2").End(xlDown)).Copy
Range("F2").End(xlDown).Offset(1, 0).PasteSpecial _
Paste:=xlValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False

nTime = Now + Time(0, 0, 5) ' 5 secs
Application.OnTime nTime, "temp"
End Sub

I place it in a standard module but it does not engage.

Thank you in advance.
 
Try TimeSerial, not Time

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Thank you Bob.

When you suggest trying "TimeSerial", not sure what you mean.

Regards.
 
He mean changing the line
nTime = Now + Time(0, 0, 5) ' 5 secs
to
nTime = Now + TimeSerial(0, 0, 5) ' 5 secs


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Thanks All. It works not but it wont stop. Bob suggested I use this:

Application.OnTime nTime, "temp",,False

How do I add this to my workbook ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top