Results 1 to 5 of 5

vba to copy an entire row or a range and paste values to next available row

Threaded View

  1. #1
    Registered User
    Join Date
    07-14-2012
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    3

    vba to copy an entire row or a range and paste values to next available row

    once again a newbie alert. I am having some serious difficulties in copying an entire row (which is constantly updating) into a new row each time. The purpose of that is to record some stocks value with the current time and to generate them instantly into a table and to automatically updating scatter chart.
    I am currently using this module:

    Option Explicit
    Public dTime As Date
    
    Sub ValueStore()
    Dim dTime As Date
        Range("D" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Range("A1").Value
        Range("C" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Range("B1").Value
        Call StartTimer
    End Sub
    
    
    Sub StartTimer()
        dTime = Now + TimeValue("00:00:01")
        Application.OnTime dTime, "ValueStore", Schedule:=True
    End Sub
    
    Sub StopTimer()
        On Error Resume Next
        Application.OnTime dTime, "ValueStore", Schedule:=False
    End Sub
    but the problem with this one is when the copy is done into a table (to automatically generate into a chart) the time value (which is done in cell B2 by the =now() function) is copied not into the same row in which the stock date is generated in the table.

    well a long story short, I need help to adjust that module into one that will copy the full row (or a certain range, lets say A1:A10) and not the specified values separately like its done now. Help will be much appreciated.
    Last edited by Cutter; 07-22-2012 at 10:39 AM. Reason: Added code tags

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