Results 1 to 11 of 11

using a timer to automate a macro

Threaded View

  1. #1
    Registered User
    Join Date
    11-30-2009
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    8

    using a timer to automate a macro

    Hi,

    I cant figure out how to get the data to be pasted in the cell below on each new event of the timer. below is teh code i'm using

    Sub ButtonCode()
         Dim rows As Integer
         ' execute macros
        rows = rows + 1
        RefreshData
        
    
        Sheets("FTSE 100").Select
        Range("B10:J10").Select (copied data will always have the same location)
        Selection.Copy
        Sheets("sheet2").Select
        Range("B" & rows).Select (want to increase the row number by one for each new set of data)   
     Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False
        Range("G18").Select
        
       
         ' submit macro to run again in 5 min
        Application.OnTime Now + TimeValue("00:01:00"), "ButtonCode"
    rows = rows
    
    End Sub
    The code updates as it should but overwrites the same cells each time.

    Any help much appreciated
    Last edited by vwm1; 11-30-2009 at 10:36 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1