sum to total monthly value in array and put it in to an other workbook.

newapa

Board Regular
Joined
Sep 13, 2012
Messages
69
Hi!

I need a macro to open a workbook (TimeSerierData.xlsm) and copy the data in the workbook into an array and then sum data by month and then put the result in another workbook called MonthSerierData.xlsm.

here the data in TimeSerierData.xlsm
Code:
Time                    Value
2013.01.01 01:00:00       522
2013.01.01 02:00:00       411
2013.01.01 03:00:00       223
---and so on till next day and next month--
here is the code so far.
Code:
sub OpenAndInsert()

dim wbOut as workbook
dim wbIn as workbook
dim ws as worksheet
dim sPath as string
Dim sFile as string
dim MyArray as string

set ws as thisworkbook.worksheets("Info")

sPath = ws.range("A2")
sFile = ws.range("A3")

set wbOut = application.workbooks(sPath & sFile).open

MyArray = wbout.worksheet("Time").Range("A1:B50").copy

application.workbooks(sPath & sFile).close


 ------ work with array and sum data by month ----

set wbOut = application.workbooks(c:\temp\MonthSerierData.xlsm).open

-------- put the sum data too the workbook---

application.workbooks(c:\temp\MonthSerierData.xlsm).close


thanks in advance and any help is appreciated[h=3][/h]
 
Last edited:

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