I'm trying to find solutions for creating a master template in Excel. We have almost 100 Excel workbooks where data in them varies but the formatting and cell and row layout including header names remains the same. When a row is deleted in one, it needs to be deleted in all of them. When a row header is updated, it needs to be updated in all of them. When conditional formatting changes in one, it needs to be updated in all of them. Get the gist?
Solutions I've researched that won't work:
Cell linking - only copies the data and not the format; doesn't account for adding/deleting rows/columns
Format Paint - doesn't work well between different workbooks and still needs to be applied to each workbook individually; doesn't copy conditional formatting; doesn't account for adding/deleting rows/columns
Power Query - formatting is based on the destination file and there's concern that when refreshed it would delete/overwrite all of the data specific to that workbook; doesn't copy conditional formatting
Find/replace - not ideal and doesn't work with exact match (when trying to replace AP it makes no distinction between AP or apply)
MS Access - for business reasons this needs to stay in Excel (i.e. can't use Access or other database programs); this option doesn't address the conditional formatting applied to all of the workbooks
I've seen numerous threads from people looking at how to create a master template in Excel. I get that its not possible (and I have no idea why Microsoft in all its wisdom hasn't created function yet), but what I'm looking for are possible workarounds. Right now the process can take a couple people several days to update all of the workbooks. Any work arounds that can reduce this to a single person in just a few hours would be fantastic.
Posting here in case someone has a VBA suggestion that would encompass everything I need. I'm using Excel 2010 and the workbooks are stored in a document library on SharePoint.
Related
tl;dr: Is there a way to have multiple (10+) excel Macro workbooks run the same project from a single location so that if I need to fix a bug, I don't need to fix it in every single workbook?
Long version:
My company uses excel workbooks for engineering charts. Any changes are formatted as bold and highlighted gray. We then have a revision "table" at the bottom (I say "table" because it's just some merged cells - there doesn't seem to be a way to make a separate table that doesn't follow the column sizing for the rest of the workbook, but that's a question for another day).
When we do a new revision, we have to first clear any formatting from the previous revision, make our changes (and format them), then insert a row to the revision "table", then unformat the previous revision entry and reformat our new revision entry. Then, we export the workbook as a PDF which we name according to our print naming format. However, it is easy to make mistakes when doing this because the file name must be manually entered according to the format.
To make this process less tedious/error-prone, I wrote a VB macro program to automate the above steps, among other things. It works great, and will be implemented on our charts company wide.
However, I can only do so much testing on my own - there are bound to be things I missed or can do more efficiently (I'm an engineer, not a professional programmer). And we have dozens of engineering chart spreadsheets. If we implement this and then I discover I need to fix a bug or make an improvement to part of the program, I don't want to have to fix it in every single workbook - that would take way too long and be too easy to miss a workbook!
Any advice would be appreciated.
my question is a pre-code question, as I would like to verify if and which is the best option to go about this - either formula, VBA or not possible.
I have a main workbook with an array of codes inside cells in sheet 1 - all in the format HXXX-XXX-XXX where X is numbers ranging from 0-9. Each code has an associated revision number as shown in the attached picture.
The workbook itself is named in the format: 'HXXX-XXX-XXX-YY Example Title' where YY can be any number starting from 0 to infinity (in theory). Only YY is subject to updates in the title. If changes are made in this workbook, then a new version is saved, with the YY changing in the title to the next consecutive number - Nothing else changes.
From this main workbook there are a large number of other workbooks (around 50) which share the same codes and revisions. My goal is to link all these workbooks up so that I only have to update a core main workbook and the rest of the codes (HXXX-XXX-XXX) revisions in all the other linked workbooks update accordingly.
The problem is that the other linked workbooks have a dynamic name in the format: 'HXXX-XXX-XXX-YY Example Title 2' where YY can be any number starting from 0 to infinity. YY gets updated to the next consecutive number if a change is made inside the document and this document is then saved as a separate document using Save As. NOTE: not all workbooks will get updated at the same time, as it all depends on which codes and therefore revisions are changing.
My question is firstly, is this possible with current excel functions to update links with ever-changing workbook links, which are saved as different files each time in the same folder?
Secondly, I have read about the INDIRECT function, but it is limited only to having the required workbooks opened at the same time as the updates to the main workbook, hence I am unsure that Formulas will work (I will be linking 50 workbooks to the main workbook) - From this I am gauging that VBA may be the best option, but I would like to double check this is possible before I begin attempting the code.
Of course the use of Formulas in the sheets would be much better, but because the file names are dynamic, and since the updated workbooks are saved as different files each time changes are made to it, I don't believe this is possible.
If I understand your problem correctly you need to differentiate between 3 things.
Using only Excel Formulas.
The problem with this is that formulas crossing workbooks have the big disadvantage, that you need to have the source-workbook open, otherwise manny formulas will not work correctly or update. You also have the disadvantage that saving the file needs still to be done automatically. The advantage is that you do not need VBA macros.
Using Power Query
With Power Query youmight be able to solve the problems with the dynamic names.You can even read a whole folder of files, combine them and do transformations without the need to open the files manually. But you still need to save new files manually and the files will only update once they are opened.
Using VBA
You can prettymuch do everything you asked in your problem description but VBA has its own disadvantages. Firstly the file-format ".xlsm" is not allowed by the IT department everywhere. Also to work, every user using the files needs to activate macros, otherwise the macros won't get executed. Therefore I think a VBA solution is better fitted if you only have a small circle of users or if you can execute the macros on your own (e.g. if the main workbook was updated, you need to execute a macro which opens, modifies and saves all affected files). After that you colleagues do not need VBA themself.
Possible solution:
To avoid VBA you could try to create a Power Query in each "other workbook". The query will read all filenames in the folder where the main workbook is located. Now you sort and filter for the workbook with the newest/highest ID/Titel automatically and load the result as an seperate Excel sheet (all that is possible with power query and without VBA).
Now you can use the "indirect" formula to use the ID/Titel to link to the newest main workbook. As mentioned above this will require that the main workbook is opened. Otherwise the indirect formula will not update the values. If that is out of the question, you probably need to go with VBA.
I'm writing a program to read some data from an OOXML Excel Workbook using Apache POI that was provided to me as example input data. There is a strange sheet named D%$&01_DevSheet at the end. It is full of formula cells with weird formulas that reference most of the other sheets in the workbook. Here is an example of one of the cells:
'Horizontal Agreements'!S15+"8I/!%4\"
It is also not visible when the worksheet is opened in Excel.
I've never run across such a sheet before. It looks like some kind of internal Excel structure. Google searches for "D%$&01_DevSheet" and "excel" "DevSheet" have turned up nothing useful.
This sheet is not present in any test workbooks I've created. However, I'm not much of an Excel user and I did not exhaustively try all Excel features.
At this point, I'm going to hard code a rule that excludes sheets ending in _DevSheet from processing. However, since this stuff is turning up in my input, I think I should understand and handle it properly, so I have some basic questions:
What does Excel use sheets like D%$&01_DevSheet for?
What user actions cause them to be created?
Are they named regularly?
What is the most reliable way of detecting sheets like this Apache POI?
Normally Excel does not use such a sheet, so it seems to be added by some specific application or tool that was used to create this Excel workbook. It seems the developer of the application stores formulas and other things in a separate sheet for separation from the user-visible content.
So likely you will need to contact/research whichever application provided this file and get more information about this sheet from there.
You can probably only exclude these sheet by name as you already did.
I have an Excel sheet which is used for bug-tracking. Each client has their own .xlsx and each application for that client has its own sheet within the .xlsx. So multiple Excel files with multiple sheets, all in the same format.
All sheets have the same headings and some columns have data validation and conditional formatting. Occasionally, however, the layout/headings or values allowed in data-validated cells, etc. must change and I have to go through each sheet and manually make the changes.
Is it possible to have a master sheet from which other sheets will inherit headings and heading styles with all cells under particular headings having data validation and conditional formatting?
(Before this is suggested, I used to simply put everything in one sheet and use filters to show a particular client/application, but this became impractical when sharing and versioning the sheets with multiple people)
The term you are looking for is a template. You create the template and give that to your 'clients' to track bugs. If you make an update to the template and give it to the client, they can just copy/paste data into the new form.
In my opinion, you're going about this the wrong way. Excel is a spreadsheet programme, while it CAN be used as a 'list' of sorts, it is a poor choice for bug tracking. If you're stuck on Office applications, use an Access database or something that can actually give you a 'front end display' separate from the 'back end data'. There are many free bug tracking software programmes on the internet. Set one of them up and just have your clients log a bug there.
Using a template and then getting the clients to copy+paste the old data is one way, but its not exactly the safest method.
If you did want to distribute a new template to your users it would be a good idea to add some import functionality. So VBA handles copying the old data across.
If you (personally) could do the changes to the template manually, then you might also be able to create a workbook+macros to "patch" the source (or a copy of the source) data in-place.
With either approach you'd probably need to add something to the source workbook to keep track of what version they have and make sure they they import from and to the correct version to prevent unhappiness in the future.
Could you show an example of a change? before and after etc
As far as I understand cells with formulas in Microsoft Office Excel can contain calculated values when serialized and saved in Office Open XML formats (specifically SpreadsheetML). This most likely applies to other types of dependencies and functions of values from other cells (like charts, pivot tables, etc.). I most likely do something wrong, but when processing this XML documents (SpreadsheetML) by external tools, that do not use any .Net components or similar APIs provided by MS, but just directly manipulating XML, I get into a problem that when I modify some content of one of worksheets Excel will still use last generated values in cells containing formulas. So when user opens generated spreadsheet he sees modified data but all the calculated fields are outdated. Now the only thing that I could find (these days) on internet was this:
http://openxmldeveloper.org/discussions/formats/f/14/p/1561/4164.aspx
This is really not a preferable solution especially if it applies to any kind of calculated cells and objects (charts, etc.) as it means partially reimplementing some SpreadsheetML processor when you do not know exactly the structure of all worksheets.
I would hope there would certainly be either an option in Excel or a configuration in one of the SpreadsheetML parts to force recalculations or to mark cells dirty, but I couldn't find one yet.
There is an assumption that scripting would help, but my lack of knowledge of that area didn't brought me to any successful results yet as I'm not sure how to include scripts into SpreadsheetML worksheet. Though I found quite some examples how to trigger recalculation and how to add open event listeners.
The easiest way is to remove the calculated value from the cell (as also noted in the link you provided).
You do not have to know the exact structure of worksheets. Just remove all occurrences of <v>#VALUE!</v> in worksheets/sheet1.xml (so that other functions will not be affected).
press F9 to recalculate all open workbooks
Excel Recalculation
Perhaps your Calculation Mode for the workbook is getting set to manual. Force this mode to Automatic when you open the workbook by setting it to null in the code with the following:
public void SetAutomaticCalculationMode(WorkbookPart workbookPart1)
{
Workbook workbook1 = workbookPart1.Workbook;
CalculationProperties calculationProperties1=workbook1.GetFirstChild<CalculationProperties>();
calculationProperties1.CalculationMode = null;
}
This will correspond to Automatic calculation mode as seen in the Options of Excel 2007 client: