+ Reply to Thread
Results 1 to 6 of 6

VBA copy and paste range values every 5 minutes to next blank column in another sheet

  1. #1
    Registered User
    Join Date
    01-29-2018
    Location
    London
    MS-Off Ver
    365
    Posts
    3

    VBA copy and paste range values every 5 minutes to next blank column in another sheet

    Dear Community,


    I have very little VBA experience and therefore am asking for any help I can get to write a VBA code to achieve the following:

    I have two sheets.

    Sheet 1 has live data being fed into it every 5 mins, comprising 7 columns and 100 rows

    Sheet 2 is currently blank, but is where I want to paste special (values) copied from Sheet 1

    I would like the copy and paste special (values) to occur evry 5 minutes to coincide with the update period for data being fed into Sheet 1.

    However, I would like every subsequent copy and paste operation to be appended to the next blank row in Sheet 2 ie directly under the last copy and paste special (values) info and again, and again and again.......(I see excel 2016 has 1,048,576 rows so this I imagine is ok)

    This could potential copy and paste for maybe 5 days so unsure also of how to keep this running.

    Any help would be much appreciated.

    Thank you for taking the time to read.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: VBA copy and paste range values every 5 minutes to next blank column in another sheet

    Try this:
    To start the process, remove the "stop" from the cell ("L1") and select some other one (for example, press "Delete" and then press enter key).
    Copying is started after changing data in cell 'A1'.

    In 'ThisWorkbook' module:
    Please Login or Register  to view this content.
    In Sheet1 module:
    Please Login or Register  to view this content.
    But it is not very tested.

  3. #3
    Registered User
    Join Date
    01-29-2018
    Location
    London
    MS-Off Ver
    365
    Posts
    3

    Re: VBA copy and paste range values every 5 minutes to next blank column in another sheet

    porucha vevrku,

    Many thank for your assistance and apologies if i confused the matter by title the topic incorrectly. The objective is to paste to next blank row and not next blank column as title suggests.
    I've have followed your code and instructions but nothing appears to happen.
    I think I am doing something run because even when I go into the modules and workbook neither codes appear in list from which you can run.

    I think I may be overlooking something probably quite obvious but cant find how to resolve.

    Many thanks again, but do hope you're able to help me over this hump.

    Kind Regards

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: VBA copy and paste range values every 5 minutes to next blank column in another sheet

    Quote Originally Posted by New2Code View Post
    ... The objective is to paste to next blank row and not next blank column as title suggests...
    These are not columns, only rows.
    Please Login or Register  to view this content.
    Quote Originally Posted by New2Code View Post
    ...I've have followed your code and instructions but nothing appears to happen...
    Try to go through all code with the 'F8' key in the vba editor.

  5. #5
    Registered User
    Join Date
    01-29-2018
    Location
    London
    MS-Off Ver
    365
    Posts
    3

    Re: VBA copy and paste range values every 5 minutes to next blank column in another sheet

    Hello again.
    Yes understand that you solution is for pasting into new things blank rows which is what I am definitely after.
    However, even after using F8 nothing is been highlighted to identify what I need to change in order to get the macros listed....I really do not know what to do from here.
    Is there maybe a simplier VBA?

  6. #6
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: VBA copy and paste range values every 5 minutes to next blank column in another sheet

    The word "stop" is used to deactivate the macro.
    If you want to enable them, you must remove the word "stop" from the cell 'L1' and select any other cell, for example 'A1', after all, here, some of your copying mechanism will transfer data to excel.
    Then wait for the data to be transferred to Excel.
    After that, after about 2 seconds, the data will be sent to sheet 2.

    Location of macros in modules according to the attached images:
    Attached Images Attached Images

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy Range and Paste only Values (ignore blank cells)
    By ksayet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2015, 04:37 PM
  2. [SOLVED] Copy and paste random cells values from a range to another sheet column with no blanks
    By macquhele in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2015, 06:05 PM
  3. [SOLVED] Copy / Paste range from one sheet to another, if cell in column A is not blank
    By Tapyr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-01-2014, 09:18 AM
  4. Macro: Copy/Paste values From Column to Next Blank Row
    By Lisseth225 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-23-2014, 05:39 PM
  5. Copy Paste Values Only From One Sheet Into Next Blank Row
    By Biegs101 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2014, 01:52 PM
  6. How to Copy and Paste Special Values Only if source Range is not blank
    By oddinho2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-20-2013, 02:51 PM
  7. Copy a Range from sheet and paste the next blank line in another s
    By ca1358 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-02-2005, 05:18 AM

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