Sum Several Workbooks
Aug 5, 2008
I've got a workbook for every department which is used to make a weekly status. Each of these workbooks contains a sheet with the 'weekly statuses over time', i.e. a table showing the weekly status for the department for week 1, week 2, week 3 etc. I've attached the file to make it easier to understand what I'm talking about, see Weekly_Test. Currently I can only see the performance of each department but I would like to be able to see the total performance for all departments, i.e. have a 'Total workbook' where all the weekly statuses are summed up weekly.
In the Weekly_Test file you can see the code which is used to generate the 'weekly status' sheets (also inserted at the end of this post). All workbooks for the departments are the same, apart from the file name which is the name of the department and this does not change. The weekly status is generated in the following way:
In the sheet 'Indtastning' (data entry) you enter the data and the date. Then click 'Update'. The sheet is then copied to a new sheet with the date and all data is copied to the table in the 'his.status' sheet. Now, I would like to add some code so that when I click 'Update' the data which is copied to the table in the 'his.status' sheet is also copied to a similar table in the 'Total' workbook.
Dim indtastArk
Dim arkDato
Public Sub Opdater()
arkDato = Cells(1, 1)
OpretDatoArk
' nulStilIndtastning
overførTilStatus
End Sub
Private Sub OpretDatoArk()
Sheets("Indtastning").Activate
With ActiveSheet
.Cells.Select
Selection.Copy
End With
ActiveWorkbook.Sheets.Add Before:=Sheets(4)......................
View 2 Replies
ADVERTISEMENT
Jun 26, 2014
I have 25 files with certain worksheets that I need to move to 25 other files.
Worksheet 1, 2, 3 and 4 in Workbook A needs to be moved to Workbook A-2014 Worksheet 1, 2, 3 and 4 in Workbook B needs to be moved to Workbook B-2014 Worksheet 1, 2, 3 and 4 in Workbook C needs to be moved to Workbook C-2014 etc....
Is there a way to do this with a macro? Preferably I would like to do this automaticly - i.e. runing the macro from a master file that
1. Opens Workbook A copies the worksheets
2. Open Workbook A-2014 paste the sheets
3. Save and close Workbook A-2014
4. Close workbook A without saving
then doing the same for Workbook B, etc.
View 5 Replies
View Related
Dec 27, 2009
Basically the main workbook opens 2 files at a time performs a calculate in the main workbook and then copies and pastes information in 3 ranges. Then closes the two open workbooks and loops and performs same operations until it hits the maximum loops. My macro is as follows and I have 3 question in capital letters.
View 3 Replies
View Related
Apr 8, 2014
I am trying to do a Vlookup between 2 workbooks. I've tried a couple different ways and none seem to be working.
From the inventory workbook I need the Stator and Rotor SN's, O.D. and I.D. only for the ones that have the Status "SHOP" to come up on the Comparison Workbook.
Attached is the two workbooks.
View 7 Replies
View Related
Jun 20, 2014
It is quite standard to create links between workbooks, and generally I do this by inserting an "=" sign in the cell I want data to appear in for Workbook 1, I then open workbook 2 where the desired data is and click on the cell housing the data I want.
I just went to do this, and upon putting the = sign in the cell I want in workbook 1 and clicking in workbook 2 nothing happens except my cursor is now in workbook 2 and the = sign just remains alone in the workbook 1 cell.
If, however, I put an = sign in a cell in workbook on and then click another cell in that sheet or a cell in another worksheet but in the same workbook a proper link is created, so the problem seems to be isolated to links to other workbooks.
View 1 Replies
View Related
Oct 22, 2008
If you are working in an excel spreadsheet that is linked to other excel files, when you double click on the cell that is linked to another workbook, it immediately opens the linked workbook if your settings are correct. How do you change your settings to enable this functionality?
View 2 Replies
View Related
Apr 24, 2009
LOOKUP for 2 different workbooks. I have been using the following codes to do the task.
View 2 Replies
View Related
Jan 13, 2013
I want to link two workbooks together with the aim that when a option is selected in a drop down menu in workbook "band form", it auto populates the rest of the form with data from the second workbook "showsales2013". date, ticket price, support acts etc etc.......
as a example,the drop down in workbook "band form" is a list of bands (list data also taken from showsales2013) ive got this bit working ok (i think ), each band is playing on a different day so i have used this formula to get the "date" from "showsales2013"
=VLOOKUP(F4,[ShowSales2013.xls]Sheet1!$1:$65536,4,0)
this seems to work until i insert a new row and/or column (in the showsales wookbook - which needs doing from time to time as new bands get booked to play), then i get #REF in the date cell on the "band form blank".
i used pretty much the same formula to pull the other needed data (price/support acts etc ) from showsale2013, and the result is the same, #REF.
View 5 Replies
View Related
Feb 6, 2014
I have a spreadsheet that I need to open two other workbooks to copy and paste data from.
The name of the two workbooks changes each day, and the location because they are filed in subfolders.
I have the following code, which works to open the first sheet but then comes up with the following error when trying to open the second sheet. "Run-time error '1004: Excel cannot access 'Hub PVA'. The document may be read only or encrypted".
The folder is not encrypted because when I was only opening the second document with the same code, it worked.
The code I am using is:
'DECLARATION
On Error GoTo ERR1:
ChDir "G:GENERALTRANSPORTDAILYPLANS"
Workbooks.Open Filename:="G:GENERALTRANSPORTDAILYPLANS"
[Code]....
View 3 Replies
View Related
May 15, 2014
I have Workbook A and Workbook B(csv file)
In workbook one I want to look for a unique code that is in both workbooks and if it is then return a result of the total.
As an example
WORKBOOK A
a0YC000000YWPE1MAP
WORKBOOK B
Code qty
a0YC000000YWPE1MAP 10
a0YC000000YWPE1MAP 1
a0YC000000YWPE1MAP 14
Result I need is 25.
What to type if it is a different workbook and not just a sheet.
View 1 Replies
View Related
Oct 12, 2006
I still have a problem with consolidation of workbooks.
Scenario:
I am working in HQ and at the end of each month, every branch under my care will submit an excel workbook to me. Inside this are two worksheets (worksheet 1 and worksheet 2 for convenience). Both have standard headers and rows and rows of data. Upon receipt, I will keep all these files in a folder called "Oct06" (and Nov06 etc for future mths)
Problem:
I'm not able to find an easy way to consolidate all the various worksheet 1 into one master worksheet. I need this so as to generate a pivot table. At the same time, I need to consolidate all the worksheet 2 also for the same purpose.
View 9 Replies
View Related
Feb 2, 2007
Copying information from various sheets from one workbook to paste into similar sheets in another workbook? It would involve switching back and forth between workbooks.
View 9 Replies
View Related
Mar 27, 2007
Is it possible to search all closed workbooks in a folder in a range B13:B33 for a particular word?
All closed workbooks have only 1 sheet in them this sheet is always named the same but the workbooks are named sequentially, eg 1, 2, 3 etc.
View 9 Replies
View Related
Apr 4, 2007
I run a number of spreadsheets each 4 week period and these are stored in a folders named after the period. ie Period 10 will contain workbookA10wk1, workbookA10wk2, workbookA10wk3 and workbookA10wk4,
Period 11 will contain the same workbooks but named workbookA11wk1 etc.
The data from the workbooks is then used in graphs / tables for each year.
I always pick up the same cell ref in each workbook to compare each week and my table is set out with heading of period and wk.
Is it possible to use the table headings to produce the names of the workbooks that you wish to reference, ie: ='Period 13[workbookA13wk1.xls]Sheet1!$D$17 to appear under Period 13, wk1
View 9 Replies
View Related
Jun 12, 2007
From a workbook, I need to open a further workbook called 'transfer' and then switch back to the original workbook. Presumably I need to save the current workbook name to a variable, open transfer with Workbooks.Open Filename:="c:debworkTRANSFER.xls"
then switch back to the original
How do i pass the original workbook name to a variable, and then reactivate it. I have tried numerous options but just cannot get it to work. Do i reactivate with workbook. activate or windows.activate
View 9 Replies
View Related
Sep 9, 2007
I'm not sure why but Excel doesn't seem to like the following.
Workbooks("Bulk Forecast.xls").Worksheets("Bulk Forecast").Range("A1:C2").Copy
View 9 Replies
View Related
Jan 24, 2008
I have got 2 excel workbooks with multiple worksheets (around 6 megs in size). Is there a way i can do a quick comparison which will point out the differences between the cells?
there is a difference in dize, 200 KB
View 9 Replies
View Related
Jul 20, 2008
I have this excellent code which I found on here that looks at the data in column A, looks at the data in column B & then returns the differences ie.
A_____________B_________C___________D______________E
John________Jimi_________________Not in A_______Not in B
Paul________Sporty________________Jimi____________John
George______Ginger________________Eric____________Posh
Ringo_______Scary_________________T-Bone__________Baby
Posh________Eric
Scary_______Ringo
Sporty______Paul
Ginger______George
Baby________T-Bone
Here is the code ....
View 9 Replies
View Related
Aug 5, 2009
I currently have a sheet (SHEET-A) which pulls in a figure from a cell (CELL-G) in another workbook sheet (SHEET-B), and displays the value in CELL-X.
CELL-X then is used for a series of calculations on SHEET-A.
CELL-Y is adjacent to CELL-X and can have a number entered into it which is then used instead of CELL-X for the calculations on SHEET-A. (It is also incidently displayed over CELL-Gs value in CELL-X)
I would like to have a button next to CELL-Y which upon click alters the value of CELL-G in SHEET-B to that of CELL-Y in SHEETA.
View 9 Replies
View Related
Aug 5, 2009
I have 5 worksheets, representing data from 5 days, M-F. On a weekly basis I open all 5 files and manually copy, and paste all into one large weekly file. Does not take very long so I am probably just being lazy but if I could find a simple solution to merge all 5 into one quickly it would be great.
The one solution I was planning on implementing was to cycle through all OPEN workbooks, copy the data into a new workbook, and close each workbook as the copy and paste is done. This will work but to me its 'dirty'. Each workbook only has one Worksheet.
View 9 Replies
View Related
Sep 16, 2009
In Workbook 1 O1, I need a formula that will, if Workbook 1 M1 = "Yes", find the value from Workbook 1 N1 anywhere in Workbook 2 Column E, and when it is found, look at the value 2 columns to the right in Workbook 2. If there is a value in this cell, return "Yes" in Workbook 1 O1. If there is no value in this cell, return "No" in Workbook 1 O1. If Workbook 1 M2 = "No", the formula should return "No".
View 12 Replies
View Related
Nov 24, 2009
I wrote a UDF that does some advanced lookup trick in a particular workbook. That workbook has to be open during this process of course. I used to have a copy of this UDF in several workbooks where I need to use it. This turns out to be bothersome since I needed to update the UDF frequently. So I decided to make an add-in.
I then copied the UDF to a new workbook, save it as an add-in (XLA), then go into Excel Options - Add-in (I use Excel 2007) and enable the add-in there. I then remove the UDF from each and every workbook that used to have it.
Now I close everything.
I then open the lookup workbook that needs to be open if I were to use the UDF. Here is where I don't understand. If I open a new workbook and use the UDF, it works fine. If I save the new workbooks then reopen them, the function still works. However if I open some old workbook where the UDF used to be and try to use the UDF, Excel gives me #Name? errors.
View 9 Replies
View Related
Jan 12, 2010
I have 85 workbooks in the same folder with a sheet in each workbook called "Budgets". Its the same template in each workbook with different data. I need to create a Summary master file of all my budgets so in the end I will have 1 Workbook with the 85 copies of the "Budgets" Worksheets. Does anyone know the VBA for this?
View 9 Replies
View Related
Feb 23, 2010
I have a macro on a workbook that when I run it, it's supposed to open a workbook, but it opens another workbook also.
How do I prevent this behavior?
View 9 Replies
View Related
Jul 11, 2006
I have 3 different excel files. Each one of them has one sheet. Column A is identical in all the sheets. The others change. I would like to insert a row, let's say between the second and the third row of the initial sheet of the first file, write something in Column A of the inserted row and excel to update the other files with the inserted row in the right position and with the text in column A. I searched all the conventional ways, but I did not find any solution.
View 5 Replies
View Related
Jul 17, 2006
I am attaching workbooks which reflect my original work. I have some questions :
1. How can I allow users to view this with everything working fine? (zipping and emailing was suggested, but I am getting some errors)
2. How can I ensure that the viewing format remains same for everyone viewing it?Al colleague of mine, tried and the formatting is wierd for him
View 3 Replies
View Related
Aug 30, 2006
I was just wondering if it was possible to do an If statment that looks at a cell in another workbook?
View 9 Replies
View Related
Sep 8, 2006
we have 1500 workbooks where the format is the same but the data could be different. I have marked up in red which i would class as headings, the rest in black are varibles
sheet 2 is how i would like it if possible. please note the file name is need to be in column A
can a macro be written to get all 1500 files into one. all the files are in one folder
View 9 Replies
View Related
Oct 7, 2006
I'm trying to write a piece of VBA code which will switch back and forth between 2 workbooks, but I was hoping that I would not have to name both workbooks in my code.
So far I have been able to name the second file as a variable, open it and copy the data I need, but I now need to switch back to the original file. Is there any way of doing this without hard coding the file name?
View 5 Replies
View Related
Nov 14, 2006
I have a UDF in a workbook that works fine until I open another workbook which contains the same UDF. When Excel does a full recalculation it not only recalculates the currently selected workbook but also recalculates all other open workbooks. Something from the currently selected workbook appears to interfere with the other open workbooks as these other workbooks show #VALUE! in all cells that use the UDF. Is there some way to make a UDF unique only to the workbook that it resides in such that opening another workbook with the same named UDF won't interfere with it?
Function SumRangeLookup(FromCode, ToCode, Database, FromColumn, ToColumn)
Dim Code As Range
Dim MonthColumns As Integer
Dim CalcResult As Double
SumRangeLookup = 0
For Each Code In Range(Database)
On Error Goto SkipCode
If Code >= FromCode And Code <= ToCode Then
For MonthColumns = FromColumn To ToColumn
CalcResult = CalcResult + Code.Offset(0, MonthColumns)
Next MonthColumns
End If
Next Code
SumRangeLookup = CalcResult
SkipCode:
End Function
View 6 Replies
View Related