+ Reply to Thread
Results 1 to 6 of 6

Configure Excel to move data from one page to subsequent pages at a specific time interval

  1. #1
    Registered User
    Join Date
    04-27-2012
    Location
    Moyock, North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    3

    Configure Excel to move data from one page to subsequent pages at a specific time interval

    I am populating Excel from a server via KEPDIRECT. At a specified time interval, I would like to move the data either over or down in the file and populate the data into subsequent cells over either a period of time or up to a specific file size. Once that criteria is met, I would like to auto save the file. I need to store this data to be distributed to co-workers, so I don't want to save over the daily files. I would like to have it save based on the days date, if possible, in order to have an archive of process data to refer to. Are these things possible and how can I do it? I have, up until now, only used the basic features of Excel. However, the storage of historical data has recently become necessary. Any help in accomplishing this would be greatly appreciated. Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Configure Excel to move data from one page to subsequent pages at a specific time inte

    All this should be easily possible with VBA.

    Moving data/inserting cells - do this manually with the macro recorder running to generate the VBA.

    Saving the workbook - do a manual file save or save as, again with the macro recorder running. Modify the VBA to include the current date (and time?) in the file name using the Format function.

    Workbook file size - I don't know how to determine the size of the active workbook without saving it first and then calling the FileLen VBA function or reading the FileSystemObject File.Size property. It might be easier instead to base the size on a specific number of rows being populated.

    To do these tasks periodically at a specified time interval use Application.OnTime - see http://www.cpearson.com/excel/OnTime.aspx.
    Post responsibly. Search for excelforum.com

  3. #3
    Registered User
    Join Date
    04-27-2012
    Location
    Moyock, North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Configure Excel to move data from one page to subsequent pages at a specific time inte

    I have figured out the time interval and I have figured out a single data transfer from A1 to G1. How can I tell the program to copy and paste in increments. For instance, in the first transfer copy starting at A1 and paste to G1, but in subsequent actions copy starting at A1 and increment over "x" number of columns to paste? So the second paste would be at M1 and the third paste would be at S1 and so on. I am still searching and studying, but any help is appreciated. Thank you.

  4. #4
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Configure Excel to move data from one page to subsequent pages at a specific time inte

    If I understand correctly, that series (G1, M1, S1) is every multiple of 6 columns + 1, i.e. column 7, 13, 19, etc.
    This code copies cell A1 to the next available column (7, 13, 19, etc.) in row 1:
    Please Login or Register  to view this content.
    Last edited by Chippy; 04-30-2012 at 02:27 PM.

  5. #5
    Registered User
    Join Date
    04-27-2012
    Location
    Moyock, North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Configure Excel to move data from one page to subsequent pages at a specific time inte

    Thank you very much. The program did exactly what I asked of it. I am now trying to learn how to modify what you provided to transfer a group of cells (A1 to C6) in the same manner. I'm hoping that I can add a range statement or something simple to make the modification. I am trying to teach myself and I greatly appreciate your help. I am a PLC technician and the need for this type of Data Storage has never before been necessary. Thank You!

  6. #6
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Configure Excel to move data from one page to subsequent pages at a specific time inte

    Quote Originally Posted by mdmull View Post
    transfer a group of cells (A1 to C6) in the same manner. I'm hoping that I can add a range statement or something simple to make the modification.
    Start by using the macro recorder to help. Manually copying cells A1:C6 and pasting to G1 (G = column 7, the first column in the series) generates the following code:
    Please Login or Register  to view this content.
    Although the macro recorder is inefficient in that it uses unnecessary Selects and does the copy-paste in several statements, it is very useful in showing the syntax of various Excel methods and objects. The 5 statements above can be reduced to 1 statement, highlighted in my updated code:
    Please Login or Register  to view this content.

+ 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