Consulting

Results 1 to 3 of 3

Thread: Macro to auto-copy a cell and paste it in a another cell at particular times

  1. #1

    Macro to auto-copy a cell and paste it in a another cell at particular times

    Macro to auto-copy a cell from particular column and pasteit in a particular cell in a different column at particular times. This macroshould automatically conduct these operations based on actual times from thecomputer

    Example: when it is 5am, the macro copies the value in cellk4 and pastes it in m1, then when it is 6am the macro copies the value in cellk4 and pastes it in m2, then when it is 7am the macro copies the value in cellk4 and pastes it in m3, and so on!
    Please assist with model code.


  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Sub Test()
    Application.OnTime TimeValue("05:00:00"), "DoCopy1"
    Application.OnTime TimeValue("06:00:00"), "DoCopy2"
    Application.OnTime TimeValue("07:00:00"), "DoCopy3"
    End Sub
    
    
    Sub DoCopy1()
    Cells(1, 13).Value = Cells(4, 11).Value
    End Sub
    
    
    Sub DoCopy2()
    Cells(2, 13).Value = Cells(4, 11).Value
    End Sub
    
    
    Sub DoCopy3()
    Cells(3, 13).Value = Cells(4, 11).Value
    End Sub
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    cross posted all over the place.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •