+ Reply to Thread
Results 1 to 10 of 10

copy range of cells automatically to different range evry hr

  1. #1
    Forum Contributor
    Join Date
    05-18-2011
    Location
    Delhi , India
    MS-Off Ver
    Excel 2007
    Posts
    171

    copy range of cells automatically to different range evry hr

    hi all ,

    i want to copy a range of cells evry hr to another range
    for eg :

    a1:a50 to b1:b50 @ 10:30AM
    a1:a50 to c1:c50 @ 11:30AM
    a1:a50 to d1:d50 @ 12:30AM
    a1:a50 to e1:e50 @ 1:30AM
    and so on

    i work in the stock market so the data in a1:a50 will keep on changing .
    so i wanted if excel can automatically copy this row to different row evry hour.

    thanx
    Last edited by Sarangsood; 06-07-2011 at 01:07 AM.

  2. #2
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: copy range of cells automatically to different range evry hr

    try to put these two functions in your workbook under ThisWorkbook VBA project:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-18-2011
    Location
    Delhi , India
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: copy range of cells automatically to different range evry hr

    thnx for ur help

    bt im nt dat familiar to vb ... so my file name is 24May 2011 nd i want to perform this function in Sheet2 ... nd can i change the hour thing to maybe halfnhour ...

    thnx again i much appreciate ur help

  4. #4
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: copy range of cells automatically to different range evry hr

    if you want to change the sheet to sheet to just change the following line:
    Please Login or Register  to view this content.
    to change the hour to 30 minutes it is done by this function,, please change it in both subs.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-18-2011
    Location
    Delhi , India
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: copy range of cells automatically to different range evry hr

    ok i made a new workbook named ThisWorkbook
    and i inserted ur code nd i changed the TimeSerial to ( 0 , 1 , 0 )
    so i press the run button nd it copies d entire row instantly bt after 1 min a message comes 'cannot run the macro "c:\documents and settings\admin\.....\ThisWorkbook.xlsx'!ThisWorkBook.MoveColumn'.The Macro may not be available in this workbook or all macos maybe disabled.

    also ,
    a1:a50 has moving values
    so will it copy the moving values or just the values at that particular time ??

  6. #6
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: copy range of cells automatically to different range evry hr

    first of all you don't have to name the workbook "ThisWorkbook" it is just an indication of the workbook in which t he code is written.
    secondly you don't need a button to start the execution the code will start running as soon as the workbook opens.
    please find attached a sample workbook for illustration.
    note that the time is set to every 10 seconds just as an example. to change it to half hour please change the timeserial function as below:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-18-2011
    Location
    Delhi , India
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: copy range of cells automatically to different range evry hr

    thnx a lot sir
    its working perfectly
    one last thing , its nt copying just the value but the whole cell as it is

    for eg a1 changes evry second or evry 10 seconds ... so will it be possible 2 copy just d value at x mins or seconds .

  8. #8
    Forum Contributor
    Join Date
    05-18-2011
    Location
    Delhi , India
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: copy range of cells automatically to different range evry hr

    nd not the whole formula as it is .
    thnx

  9. #9
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: copy range of cells automatically to different range evry hr

    If you want to copy just the values please change the MoveColumn Sub as follows:
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    05-18-2011
    Location
    Delhi , India
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: copy range of cells automatically to different range evry hr

    woww .. thnx a lot sir
    this has made a real difference in my worksheet

    i just cant thank you enuf :D

+ Reply to Thread

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