Copy/Paste Controlled by Timer

How can I create a macro that calculates a time interval, say 10 seconds, and 
then copies all data from column B to column C, then waits 10 minutes, then 
copies columns C to D, waits 10 minutes, then copies D to E, and so on and so 
forth. 

Thanks!


-- 
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
0
Utf
12/8/2009 6:21:01 AM
excel.programming 6508 articles. 2 followers. Follow

4 Replies
948 Views

Similar Articles

[PageSpeed] 26

Look at Application.OnTime

eg.

Dim col As Integer

Sub StartItUp()
   col = 2
   Application.OnTime Now + TimeSerial(0, 0, 10), "DoCopy"
End Sub


Sub TimedCopy()
   Sheet1.Columns(col).Copy Sheet1.Columns(col + 1)
   col = col + 1
   If col < 100 Then
    Application.OnTime Now + TimeSerial(0, 10, 0), "DoCopy"
   End If
End Sub


Tim

"ryguy7272" <ryguy7272@discussions.microsoft.com> wrote in message 
news:431B258C-91A0-48C6-834D-5D0EB11A3FF1@microsoft.com...
> How can I create a macro that calculates a time interval, say 10 seconds, 
> and
> then copies all data from column B to column C, then waits 10 minutes, 
> then
> copies columns C to D, waits 10 minutes, then copies D to E, and so on and 
> so
> forth.
>
> Thanks!
>
>
> -- 
> Ryan---
> If this information was helpful, please indicate this by clicking ''Yes''. 


0
Tim
12/8/2009 7:05:00 AM
hi
i think you may be interested in the ontime method.
in vb help, type ontime. select ontime method
also see this site. lot of how to start and stop timers.
http://www.cpearson.com/excel/OnTime.aspx

Regards
FSt1


"ryguy7272" wrote:

> How can I create a macro that calculates a time interval, say 10 seconds, and 
> then copies all data from column B to column C, then waits 10 minutes, then 
> copies columns C to D, waits 10 minutes, then copies D to E, and so on and so 
> forth. 
> 
> Thanks!
> 
> 
> -- 
> Ryan---
> If this information was helpful, please indicate this by clicking ''Yes''.
0
Utf
12/8/2009 7:18:01 AM
Thanks FSt1!  I've seen that before.  Forgot about it; thanks for reminding 
me.  One more thing, how can I start in column B, copy then paste one column 
to the right, then copy then paste that column (now in column C) and copy 
then paste one to the right (now in column D) and copy then paste one to the 
right (now in column E)...etc...

Thanks!
Ryan---

-- 
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"FSt1" wrote:

> hi
> i think you may be interested in the ontime method.
> in vb help, type ontime. select ontime method
> also see this site. lot of how to start and stop timers.
> http://www.cpearson.com/excel/OnTime.aspx
> 
> Regards
> FSt1
> 
> 
> "ryguy7272" wrote:
> 
> > How can I create a macro that calculates a time interval, say 10 seconds, and 
> > then copies all data from column B to column C, then waits 10 minutes, then 
> > copies columns C to D, waits 10 minutes, then copies D to E, and so on and so 
> > forth. 
> > 
> > Thanks!
> > 
> > 
> > -- 
> > Ryan---
> > If this information was helpful, please indicate this by clicking ''Yes''.
0
Utf
12/8/2009 4:06:02 PM
I ended up going with two columns, and got it working with this:

Dim i As Long
Dim iCol As Long
Dim num As Long

iCol = 7
num = 100

Columns(iCol).Select
    Range("IV1").Select
    Selection.End(xlToLeft).Select


For i = 0 To num
    
    Selection.EntireColumn.Copy
    ActiveCell.Offset(0, 2).Select
    ActiveSheet.Paste
    
Next i

Thanks!
Ryan--

-- 
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"ryguy7272" wrote:

> Thanks FSt1!  I've seen that before.  Forgot about it; thanks for reminding 
> me.  One more thing, how can I start in column B, copy then paste one column 
> to the right, then copy then paste that column (now in column C) and copy 
> then paste one to the right (now in column D) and copy then paste one to the 
> right (now in column E)...etc...
> 
> Thanks!
> Ryan---
> 
> -- 
> Ryan---
> If this information was helpful, please indicate this by clicking ''Yes''.
> 
> 
> "FSt1" wrote:
> 
> > hi
> > i think you may be interested in the ontime method.
> > in vb help, type ontime. select ontime method
> > also see this site. lot of how to start and stop timers.
> > http://www.cpearson.com/excel/OnTime.aspx
> > 
> > Regards
> > FSt1
> > 
> > 
> > "ryguy7272" wrote:
> > 
> > > How can I create a macro that calculates a time interval, say 10 seconds, and 
> > > then copies all data from column B to column C, then waits 10 minutes, then 
> > > copies columns C to D, waits 10 minutes, then copies D to E, and so on and so 
> > > forth. 
> > > 
> > > Thanks!
> > > 
> > > 
> > > -- 
> > > Ryan---
> > > If this information was helpful, please indicate this by clicking ''Yes''.
0
Utf
12/8/2009 11:59:01 PM
Reply:

Similar Artilces:

Moving from 2 domain controllers to 1 with exchange 2003 in the m
Help!! I would like to demote one domain controller of two leaving me with only one domain controller. The problem is i have Exchange 2003 in the domain which is not necessarily a problem. I am concerned that by demoting the backup domain server that there will be a problem with connectivity with exchange. Does anyone have any suggestions or solutions? Please let me know. Note: the primary domain controller does the Global cataloging and config so this should be not problem right? Hi Rox, AD doesn't really have PDC and BDC like earlier versions of windows. You can certainly dem...

How to avoid the Beep when Enter key is pressed in CEdit control
This is a not-multiline CEdit control. I don't want that when I press Enter key, control to beep. I tried by using OnKeyDown event without calling the default handler, but it didn't work. Thanks Jaime "Jaime Stuardo" <jstuardo@softhome.net> wrote in message news:eJCIlEDcDHA.1580@tk2msftngp13.phx.gbl... > This is a not-multiline CEdit control. I don't want that when I press Enter > key, control to beep. I tried by using OnKeyDown event without calling the > default handler, but it didn't work. Try a WM_CHAR handler either instead or in addition... ...

Copy Microsoft Outlook Calendar folder
Hi! I've just set up an Excahnge Server infrastructure. On my client desktop, I have Microsoft Outlook 2003 instaled. I wish to move all the items of the Microsoft Outlook Calendar folder still in the Personal Folder (old POP e-mail account) to the new Calendar folder in the Microsoft Exchange Server account. Is there an easy way to do that? The right-click copy Calendar option creates a new calendar folder named Calendar1 and I wish to have the items in the "real" Exchange Server account Calendar folder. Help appreciated. Nicolas Nicolas Macarez wrote: > I wish to ...

Copying range format and formulae without data
I want to set up a macro that copies a range to a new range, copying formulae and cell formats, but ignoring raw data existing in the range copied from. In other words I'm expanding a blank copy for a new period. One way would be to name a blank copy in a range elsewhere and copy it in at the cursor, but for various reasons I'd prefer not to do it that way this time. I have made a 2 stage copy procedure, using the "Paste Special" Alt ESF and Alt EST routines, but this process also copies raw data, presumably seeing the data as a label, even although I have formatted the...

Graph links to copied sheet
Hi I have noticed a difference between Office 2003 and 2007. In 2007 when you copy a sheet with graphs in it, the new sheet keeps the links to the table in the original sheet not the copied one. So when you input new values on the new table the graph does not show them, but the old ones. Does anyone know how to change settings so the new graph has the links to the new table/sheet? Many thanks PS Also, anyone knows how to eliminate some sections of the ribbons? Miguel - I think this discrepancy existed in early versions of 2007, but in SP2, and I think SP1, a chart on a copied shee...

Copy #2
Hi... I have a small problem but still need some help. I have a workbook called "Sumary.xls" located in a folder Dim strPath As String Dim strParent As String Dim pos As Long Dim Slutt As String strPath = ActiveWorkbook.Path **** Then i have to open another workbook called "Statistikk.xls" pos = InStrRev(strPath, "\") strParent = Left(strPath, pos - 1) Slutt = strParent & "\VT" & "\VT" & "\Arkiv\" & "Statistikk.xls" Workbooks.Open Slutt ***Everything is ok with this, but: ***** Then i want to...

Newbie Question-Pasting Multi-Row Data into Accumulating List With Macro
I have a two page worksheet. On the first page, data is entered into a 7 row by 6 column table. Several computations are done on all the data and a weekly report can be printed. I want to accumulate that weekly data in a list on the second page using a macro. I have recorded a macro that will copy all the current week's entries from the first page and "paste special" the data values onto the second page with a single click on a button located on the first page. What I can not figure out is how to paste the subsequent week's data below the previous set of data. Be...

copying calendar from one drive to another
Hi wonder if anyone can help? I installed a new drive and had the old drive as a slave. The new drive is fine and boots up no problem, the old drive if I make that one boot up in DOS won't. I need to copy the calendar files from the old drive to the new one for Outlook but I don't know where they are stored, can anyone help me please? Paul -- Paul Robinson Your calendar data, as well as messages, tasks, notes, contacts, etc. are stored in a file with a .PST extension. Look here for all the information you need on backup and restoration of Outlook data: http://www.slipstick.co...

Why Does My Form Copy Values From My Lookup Box To The Other Recor
Hi - I am using Access 2003, and am not very familiar with Access or its terminology. I am not at all familiar with VB. I created a form from a query, and everything is generally working fine. One of the fields on the form is based on a lookup table for location. I have assigned a default value of 1 (which translates to NOT CHOSEN), and that's how everything shows up when I go into the form. I assigned the default both in the originating table and in the box on the form itself. However, when I change the first record to a different value (say, 2 which translates to QUEE...

how to control the gray line on the border?
I copied and pasted data from web and the gray lines disappears at the cells I pasted on. The gray lines like the borders but can't be controlled by applying the styles in "Borders". How can I make them reappear? Also, how can I apply borders setting on multiple cells. If I highlight multiple cells and apply a bottom line, all it does is apply it at teh last row instead of all the rows highlighted. Thanks for the help, liu On Aug 15, 1:48=A0pm, cpliu <spamfree...@yahoo.com> wrote: > I copied and pasted data from web and the gray lines disappears at the > cells I p...

A quick way to copy a file.
I'm using Visual C++ Version 6. From within my program, is there a quick command to copy a file from one place to another? Webster wrote: > I'm using Visual C++ Version 6. > > From within my program, is there a quick command to copy a file from one > place to another? How about google: api "copy file Best, Dan. These Api's will Help 1.CopyFile 2.SHFileOperation -- With Regards Alok Gupta Visit me at http://alok.bizhat.com "I think this will Help" "Webster" <webster@mail.com> wrote in message ...

How do I copy a formula in excel where part remains absolute the .
=VLOOKUP(A2,Sheet2!A1:B664, 2, FALSE). I want the A2 to change when I go to the next cell but I need the Lookup range in sheet 2 (A1:B664) to reamin the same. Thanks Putting dollar signs around the lookup range: Sheet2!$A$1:$B$664 will make it absolute (locked) So, assuming the lookup values are listed in A2 down you could put in say, B2: =VLOOKUP(A2,Sheet2!$A$1:$B$664, 2, FALSE). and just copy B2 down -- Rgds Max xl 97 --- GMT+8, 1� 22' N 103� 45' E xdemechanik <at>yahoo<dot>com ---- SRF <SRF@discussions.microsoft.com> wrote in message news:8F4FE3B3-DAC4-4BCB...

Copying Back end to web-based server
Hello, I have a split front end and back end database. I'm trying to put it on a server that is webbased so that when I try to copy, it says it doesn't accept locked files. Is that mean it's making it a read-only copy? When I try to copy a simple MSAccess databse, I get the same error, but when I copy a MS Word document, I have no problem. Has someone had this problem before and what did you do? Varvara ...

OLE. ActiveX Control. Calendar Value
I am trying to put the value of the calendar form in a txtBox on a form. I have a txtBox with a button next to it. When I click on the button, it opens the Calendar form. The Calendar form as 3 buttons, a Cancel, Exit and Ok buttons. When I click on the Ok button, I want the value of the Calendar to go in the txtBox on the form and I want the Calendar form to close. I can't figure out how to do this. The Cancel and Exit button works fine. I just don't know how to pass the value of the Calender to the txtBox. Any help will be greatly appreciated. Thank you. Ayo Set the control...

copy named range & paste values
This works great with columns, but now need to copy named range ActiveCell.EntireColumn.Value = ActiveCell.EntireColumn.Value (my attempt) Sub select_range() Range("zero_range").Select Copy.Range Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False End Sub Range("zero_range").value=Range("zero_range").value -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "J.W. Aldridge" <jeremy.w.aldridge@gmail.com> wrote in message news:c6f61ae2-a365-43c0-a...

ActiveX control question...
Hi, I'm working on an ActiveX control project (created with the MFC ControlWizard) and I'm encountering a difference I can't understand. I use VB 6.0 to test out my control and I noticed that if I view the control class itself (derived from COleControl) I can view any of the object's properties through the VB 6.0 debugger. However if I create an additional automation object in my control (derived from CCmdTarget) I cannot see any properties through the VB 6.0 debugger, however the object behaves correctly and Intellisense sees them fine when not debugging. When viewing the o...

how do I sort, cut and copy pictures with cell?
I did select the related option under Tools, Edit it did not work. Also, I selected the picture then clicked Format, Picture and under the Properties tab I selected "move and size" and that did not work either. Thanks. First off, I don't know if you understand this but the pictures aren't part of the cell. They're inherantly floating above it on the drawing layer. Most users don't realize this but for this project it makes a difference. I imported some clip art, made sure I followed the same steps you did, and came to the conclusion that the picture wont move...

copying chart to location within same workbook
I have created a chart that I wish to use as a template for many other charts in the same workbook. I copy it by right-clicking on the tab, ‘name of chart' sheet, select ‘move or copy’, tick the ‘create a copy’ box and okay. I have done this hundreds of times in Excel over the last year, but now I get the message: A formula or sheet you want to move or copy contains the name 'check', which already exists on the destination worksheet. Do you want to use this version of the name? To use the name as defined in the destination sheet, click Yes. To rename the range refe...

Error accessing control when form not open
On a form when trying to get a value from a field it displays Run-time error 2450 when the form is not open. In this case instead of displaying the error how can I get a value from a control on a different form? You can only get a value from an open form that is displaying that value. Just refer to the control on the open form: [Forms]![OtherForm]![Text1] Use DLookup to get a value from an underlying table. The form does not need to be open. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Robin9876" <robin9876@hotmail....

Copy PST file?
I use Outlook 2003 on both desktop & laptop computers. I want to copy the laptop PST file file use on the desktop but continue it's use on the laptop. How do I do this? (I downloaded MSoft's backup plugin but it is not working - no backup choice on the file menu). MSoft's instructions on doing this are confusing to me. Thanks in advance... Bob This should do exactly what you want: http://www.howto-outlook.com/howto/backupandrestore.htm -- Kathleen Orland Outlook Tips: http://www.outlook-tips.net/ http://www.howto-outlook.com/ "Bob Newman" wrote: ...

Control On Cell Input
Hi, how do I put a control on a cell so that only a "-" i.e. -8 can be entered or conversely a control so that only a positive number can be entered. Thanks so much. Laura11;670644 Wrote: > Hi, how do I put a control on a cell so that only a "-" i.e. -8 can be > entered or conversely a control so that only a positive number can be entered. > > Thanks so much. Data|Validation... Allow:Decimal (or WholeNumber) Data:'less than or equal to' Maximum:0 OK. for positive numbers, it should be obvious now. -- p45cal *p45cal...

Simple question? Ultimate Grid Control #2
This should be fairly straight-forward. I hope I ask the question clearly. If not, feel free to chastise me for it. :) I have an MFC application. In the CMainFrm class I respond to menu events. In the View class, I created a grid control using the Ultimate Grid Control from CodeProject. By the way, it's a really cool tool. My simple question: "What is the best way to access the grid control (created in the CView class, from the CMainFrm class?" Have I done something fundamentally wrong by structuring my program this way? Thanks in advance. ...

Copy and paste color
I have a document that is protected and I have managed to put formulas on certain cells with a background color. When my worker copies and pastes the information into a new document since the cells she is copying are in color they paste in color is there any way where when she copies and pastes she only paste the numbers or data instead of the color of the cell? Thanks, -Sophie Paste values only "Sophie" wrote: > I have a document that is protected and I have managed to put formulas on > certain cells with a background color. When my worker copies and pa...

problems with copying data to clipboard
Hi, I've been working on this for some time, and I can't figure out my problem. I'm using samples straight from the newsgroups for my code, but I get an Unhandled Exception: User breakpoint when my code calls SetClipboardData. Here is my code. It gets text from a CListbox, coverts it to a CString, and follows the usual procedure for pasting it to the clipboard. I've changed the strcpy line from copying the curItem string to copying a simple "test" string, and it doesn't work either. Please help!!! Jay Here is my code: void CCRCCalculatorDlg::OnBnClickedC...

Copying multiple cells formula and paste as Values in same locations
Hi, I hope someone can help me with a code to handle this problem I hav been facing at work. Column AW (Order Qty) and column DZ (Order By) are the vlookup formula that display the result. The PartNumbers are filtered that show only selected rows. How can I selectively copy certain formula cells and paste as onl values in the same cells again ? Thanks so much in advance. columnA columnAW columnDZ PartNum. Ord.Qty OrderBy row228 100-344 223 SIEMENS row610 10-236W 173 SONY row997 2202246 454 HITACHI row2169 2244W 6...