+ Reply to Thread
Results 1 to 8 of 8

VBA Copy and Paste to Infinite Range?

  1. #1
    Registered User
    Join Date
    01-24-2013
    Location
    St Lucia
    MS-Off Ver
    Excel 2010
    Posts
    9

    VBA Copy and Paste to Infinite Range?

    Hello, this is my first post!

    I have a question regarding some code I'm almost finished with, and I could use some assistance.


    The code is designed to copy a range, and paste it every interval. The problem is, I would like it to continue to do so until I manually break it, thus running constantly in the background to record some data I'm researching. Currently, the code stops at whatever range I have defined (in this case, row 360), but I would like it to paste values infinitely. It is this line of code here that does so, how do I change it?:

    Please Login or Register  to view this content.
    Also, because it continuously updates, I'm not able to scroll to the top to stop the macro if need be, I always have to break it or stop it thru the F11 menu. Is there a way where it will update, yet keep the view of the top of the spreadsheet. I do not need to see the values pasting, I’d rather always see the buttons up top. This would be greatly appreciated!

    Here's my current code (I found most of it online and added some extras of my own):

    Please Login or Register  to view this content.
    Please see the excel below if you need to see how I've set it up. I could really use some help on this guys! Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Copy and Paste to Infinite Range?

    Hello VICEROY,

    Here is the updated macro. I added a new value "TimerEnabled" that stops the timer when the "Stop Timer" button is clicked. This has been added to the attached workbook. Row 1 has been frozen to allow you access to the buttons at all times.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-24-2013
    Location
    St Lucia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Copy and Paste to Infinite Range?

    Leith, thank you so much for the timer and the fixed row at the top!

    However, my code still stops at a range (36) that I've specified, because this is a portion of code that I found on another forum. Would you know how to take that away so that it runs infinitely downward until I stop it?

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Copy and Paste to Infinite Range?

    Hello VICEROY,

    Sorry, I forgot to change that in the code. There is one line that you need to change.
    Please Login or Register  to view this content.
    This will utilize all the available cells in column "A" of the worksheet.

  5. #5
    Registered User
    Join Date
    01-24-2013
    Location
    St Lucia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Copy and Paste to Infinite Range?

    You don't understand how grateful I am. I've been working on this for weeks, and having no experience with VBA its been such a project. I can't thank you enough!!

  6. #6
    Registered User
    Join Date
    01-24-2013
    Location
    St Lucia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Copy and Paste to Infinite Range?

    Leith, I've had a new issue come up regarding the code.

    I would like help automating this macro to start at TimeValue("06:30:00'"), and end at TimeValue ("16:30:00"), every monday thru friday.

    The problem is, I have gotten all mixed up with my time interval and start time of the macro, and for some reason, it only starts the macro, copies one value, and then stops, which tells me I've messed something up.

    Ultimately, I would love for this to run constantly and automatically without having to touch it. My PC is always on, and excel is always open, so that won't be a problem. The issue is having it run fluently without my manual supervision. Below is the code I've edited so far, please let me know what I've made a mistake on!!

    Please Login or Register  to view this content.

    Oh! Also, I've posted the same question here as well: http://www.vbaexpress.com/forum/show...751#post285751

  7. #7
    Registered User
    Join Date
    01-24-2013
    Location
    St Lucia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Copy and Paste to Infinite Range?

    Leith, I've had a new issue come up regarding the code.

    I would like help automating this macro to start at TimeValue("06:30:00'"), and end at TimeValue ("16:30:00"), every monday thru friday.

    The problem is, I have gotten all mixed up with my time interval and start time of the macro, and for some reason, it only starts the macro, copies one value, and then stops, which tells me I've messed something up.

    Ultimately, I would love for this to run constantly and automatically without having to touch it. My PC is always on, and excel is always open, so that won't be a problem. The issue is having it run fluently without my manual supervision. Below is the code I've edited so far, please let me know what I've made a mistake on!!

    Please Login or Register  to view this content.

    Oh! Also, I've posted the same question here as well: http://www.vbaexpress.com/forum/show...751#post285751

  8. #8
    Registered User
    Join Date
    01-24-2013
    Location
    St Lucia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Copy and Paste to Infinite Range?


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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