about macro programming

Varsha Kattekar

New Member
Joined
Nov 4, 2005
Messages
1
hi friends,
i have a problem in excel regarding to macro. i want to copy a cell
(Eg. E1) from one workbook to another everyday at 2:30pm in continuous form(downward form) i.e the destination worksheet had dates so it should be copied as per the dates at 2:30 pm everyday. Hope u can solve it. please
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Welcome:

Undtested, but:

1. Press Alt-F11 to open VBA
2. In the left pane, double-click "ThisWorkbook"
3. In the right pane, paste this in:

Private Sub Workbook_Open()
Application.OnTime (#2:30:00 PM#), macro1
End Sub

4. From the insert menu, choose module.
5. In the left pane, double-click "Module1"
6. In the right pane, paste this in:
Sub macro1()
[a1].Copy Destination:=[b65536].End(xlUp).Offset(1, 0)
End Sub

You may need to change the macro to test that it hasn't already been done and also that it posts in the right spot.
 
Upvote 0
Code:
Public Sub ONE_THIS_JUST_ONCE()
    Application.OnTime (#2:30:00 PM#), "QuietlyCopyData"
End Sub

Public Sub QuietlyCopyData()

    ' hide excel
    Application.Visible = False
    
    
    'Get Value from Source workbook without opening it
     SourceValue = ExecuteExcel4Macro("'C:\[test.xls]Sheet1'!R1C1")
     
     'Place value in sheet1 of this workbook
     With ThisWorkbook.Sheets("Sheet1")
        NextRow = .Cells(65536, 1).End(xlUp).Row + 1
        .Cells(NextRow, 1).Value = SourceValue
     End If
     
     ' Close Target Workbook
     ThisWorkbook.Save
     ThisWorkbook.Close
     Application.Quit
 
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,517
Messages
6,119,984
Members
448,935
Latest member
ijat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top