ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Macro to copy latest data from one Workbook to another (https://www.excelbanter.com/excel-programming/364157-using-macro-copy-latest-data-one-workbook-another.html)

Kayote[_5_]

Using Macro to copy latest data from one Workbook to another
 

Guys,

Heres the intro...

What Im THINKING of doing is creating a workbook that will only hav
graphs so those people in the management who dont feel comfortable wit
figures can grasp the basic info just by looking at the graphs...

What I donot want to do is update the graph workbook everyday as i
takes its data from quite a few other workbooks. What Im thinking of i
that I would have a macro that would copy the latest date's figures fro
each sheet in the workbooks and paste them in the graph workbook.

So any ideas how should I go about doing this... I cant think of an
command that would let me do this, looping would start from first dat
(in the data files) but that would ruin my spreadsheet as my grap
report doesnt take into account all the last couple of years dates...

Please advise.

cheer

--
Kayot
-----------------------------------------------------------------------
Kayote's Profile: http://www.excelforum.com/member.php...fo&userid=3331
View this thread: http://www.excelforum.com/showthread.php?threadid=55156


Tom Ogilvy

Using Macro to copy latest data from one Workbook to another
 
If your graphs already exist

Sub BuildChartBook()
Dim bk as Workbook, sh1 as worksheet
Dim sh as worksheet, rw as Long
Dim cht as ChartObject
set bk = Workbooks("Chart.xls")
set sh1 = bk.Worksheets(1)
rw = 5
for each sh in Workbooks("GraphMaster.xls").Worksheets
for each cht in sh.chartObjects
cht.copypicture
bk.Activate
sh1.Activate
sh1.Cells(rw,2).Select
sh1.Paste
rw = rw + 20
Next
Next
End Sub

If you want to manipulate the graphs, turn on the macro recorder while you
do it manually, then turn off the macro recorder and look at the recorded
code. then generalize the code and combine it with some form of the first
macro.

--
Regards,
Tom Ogilvy


"Kayote" wrote:


Guys,

Heres the intro...

What Im THINKING of doing is creating a workbook that will only have
graphs so those people in the management who dont feel comfortable with
figures can grasp the basic info just by looking at the graphs...

What I donot want to do is update the graph workbook everyday as it
takes its data from quite a few other workbooks. What Im thinking of is
that I would have a macro that would copy the latest date's figures from
each sheet in the workbooks and paste them in the graph workbook.

So any ideas how should I go about doing this... I cant think of any
command that would let me do this, looping would start from first date
(in the data files) but that would ruin my spreadsheet as my graph
report doesnt take into account all the last couple of years dates...

Please advise.

cheers


--
Kayote
------------------------------------------------------------------------
Kayote's Profile: http://www.excelforum.com/member.php...o&userid=33314
View this thread: http://www.excelforum.com/showthread...hreadid=551560




All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com