PC Review


Reply
Thread Tools Rate Thread

Adding A "Timer" to a Macro

 
 
=?Utf-8?B?Y2FybA==?=
Guest
Posts: n/a
 
      21st Feb 2006
I am uusing this:

Sub temp()
Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Range("F2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub

Is possible to have this macro execute every "n" seconds and when it
executes, to go to the next "free" column to paste the data - for example on
the 2nd execution the data would get pasted in G2, 3rd execution in H2 etc.

Thank you in advance.
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      21st Feb 2006
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


You will need to stop it at some time


Application.OnTime nTime, "temp",,False


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"carl" <(E-Mail Removed)> wrote in message
news:03BD01F1-102A-4CD4-8173-(E-Mail Removed)...
> I am uusing this:
>
> Sub temp()
> Range("C2").Select
> Range(Selection, Selection.End(xlDown)).Select
> Application.CutCopyMode = False
> Selection.Copy
> Range("F2").Select
> Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,

SkipBlanks:= _
> False, Transpose:=False
> End Sub
>
> Is possible to have this macro execute every "n" seconds and when it
> executes, to go to the next "free" column to paste the data - for example

on
> the 2nd execution the data would get pasted in G2, 3rd execution in H2

etc.
>
> Thank you in advance.



 
Reply With Quote
 
=?Utf-8?B?Y2FybA==?=
Guest
Posts: n/a
 
      27th Feb 2006
Hi Bob. Tried to contact you direct last week on this one. Cannot get the
timer to work. Do I need to download the code ?

regards.

"Bob Phillips" wrote:

> 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
>
>
> You will need to stop it at some time
>
>
> Application.OnTime nTime, "temp",,False
>
>
> --
> HTH
>
> Bob Phillips
>
> (remove nothere from email address if mailing direct)
>
> "carl" <(E-Mail Removed)> wrote in message
> news:03BD01F1-102A-4CD4-8173-(E-Mail Removed)...
> > I am uusing this:
> >
> > Sub temp()
> > Range("C2").Select
> > Range(Selection, Selection.End(xlDown)).Select
> > Application.CutCopyMode = False
> > Selection.Copy
> > Range("F2").Select
> > Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,

> SkipBlanks:= _
> > False, Transpose:=False
> > End Sub
> >
> > Is possible to have this macro execute every "n" seconds and when it
> > executes, to go to the next "free" column to paste the data - for example

> on
> > the 2nd execution the data would get pasted in G2, 3rd execution in H2

> etc.
> >
> > Thank you in advance.

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding to a "list sheet names" macro ... StargateFanNotAtHome@mailinator.com Microsoft Excel Programming 2 4th Jun 2009 06:23 PM
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running leejinhoo@gmail.com Microsoft Excel Programming 5 16th May 2007 08:18 PM
Re: Slow "look in:", "save as" menus - no adding of "http://" in brows Leythos Windows XP General 1 26th Aug 2005 06:55 PM
Outlook adding " (E-mail)" to EmailDisplayName field in "To:" and "CC:" boxes StepHenHairNet Microsoft Outlook Contacts 6 16th Jun 2005 03:46 PM
Adding code to create fldr to the "saving embedded graphics" macro?? StargateFan Microsoft Outlook VBA Programming 11 2nd Apr 2005 09:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:56 AM.