Excel VBA: List of changes - excel

In Excel I can activate "Track changes while editing." with "Select "Highlight changes on screen.", and I get all changes visible.
Now I want to generate a complex report of all these changes, so I need a way to access this information via VBA. Unfortunatly there is no "Workbook.Changes" Property.
Does anybody know how to do it?
Kind regards,
Thomas

Depending on what you need to track changes for, you might be able to use Spreadsheet Compare to help report on changes. It's an Excel Addin with lots of options for reporting on the differences between 2 workbook.
If you save a copy of the workbook before editing it, you could use this tool to summarize the differences after edits.

Did you notice that there is a built in option that allows you to 'List changes on a new sheet' ?
The best macro is no macro. (old Excel proverb)

Related

Use the Same Excel VB Code In Multiple Workbooks Used by Multiple Users Without Having to Update Each Workbook

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.

Is there a way to make Ribbon changes in excel unique to the current workbook?

This maybe a simple/ridiculous question, but I am trying to make changes to the ribbon in excel (removing all other tabs and just having my own with macros etc).
This is to be used as a basic data entry workbook for other users...
My only issue is that when the changes are made it applies it to every other workbook that I open in excel, I was thinking that there should just a setting that you could change to apply the changes. But looking online I am thinking that I need some VBA, that changes the ribbon on opening and closing of the spreadsheet?
Can anyone confirm/deny this? point me in the right direction?
You can embed your ribbon customizations along with VBA macros into a macro-enabled workbook, so your customizations will be available only to the particular file. The samples that shows how to hide or display ribbon tab/group with getVisible callbacks are available for download.
Thanks for all the replies but it seems as though the only way to do what I wanted to download an UI editor...
Unfortunately, I am limited to what I can download on a work PC/also I just presumed that with a bit of quick VBA magic I would be able to achive what I wanted. But it seems as though that VBA can't edit the ribbon without help from the UI editor.
I think I will just leave the ribbon alone for now!
Take a look at this:
https://github.com/fernandreu/office-ribbonx-editor
This project contains a great guide that you need to read in order to address your question. I will not go over specifics, as you asked to be pointed into the right direction.
The README file specifies how you can add a custom tab/buttons etc. to a particular excel file. This tab will not show up in any other workbook, as it will be encoded directly in the workbook.
So to shortly answer your question - yes, it is possible. Please see the attached documentation, as I cannot guess what you intend to do, as you did not describe what specific effect you wish to achieve.

Excel: quick access to an external macro from any spreadsheet

I have a bunch of csv files that I create everyday and that I want to format nicely with colors and stuff.
So I wrote a macro that do all I want.
Now I'm looking for the most practical way to call that macro from Excel.
It looks like macros are stored in the spreadsheet and can't be "global" or "external".
So when I open a csv, I need to create a new macro, paste my vb code, and run it.
It would be great if I could add a button to Excel toolbar, or at least open a menu that will let me select the macro and run it.
It looks like one answer could be to create an excel add-in, but I'm not sure this is the right way to go.
Thanks a lot for your help
This will work with a so-called "Personal Macro Workbook". In Excel 2010, it will be called Personal.xlsb and reside somewhere in your users directory.
See http://office.microsoft.com/en-001/excel-help/copy-your-macros-to-a-personal-macro-workbook-HA102174076.aspx for details. This also applies with small variations to other versions of Excel.

LastDate-time when cell has been modified

I have excel spreadsheet
I am looking to know date-time when my excel cells have been modified last time.
Can I do it in Excel or Access?
If yes, what function I can use?
Thanx!
in Excel, you can Track Changes
This opens up the workbook for sharing, and you can even tell Excel to track specific cells, and if you want your changes tracked or not.
This is an example of what you see when values are changed:
You can use this Track Changes feature to find out the last modifier date of a cell and find who the user was.
How to Track Changes in Excel 2007
http://www.online-tech-tips.com/ms-office-tips/track-changes-in-excel/

Is there a way to trigger "track changes" through VBA in Excel?

I want from VBA to start/stop "Track changes" functionality in Excel.
Searching thru the Net I saw a property called TrackRevisions of ActiveDocument object. Supposedly in MS Word writing ActiveDocument.TrackRevisions = True should turn on "Track changes".
But in MS Excel this line gives 424 Object required run-time error. Same error is returned when trying with ThisWorkbook. Changing it to ActiveSheet brings 438 Object doesn't support this property or method error.
For a shared workbook you can use VBA from these links (the method is ActiveWorkbook.HighlightChangesOptions)
HighlightChangesOptions Method Excel 2003 VBA Language Reference
Workbook.HighlightChangesOptions Method
Office 2007
Workbook.HighlightChangesOptions Method (Excel)
Office 2010
This doesn't offer the same depth of tracking as available in Word, for example from the first link in my post,in Excel:
Change tracking differs from undo and backup
Some types of changes are not tracked Changes that you make to cell contents are tracked, but other changes, such as formatting changes, are not tracked.
Change history is kept only for a specific interval
Change history is periodically deleted
If that isn't what you were chasing you may be able to employ specific VBA to track
certain cells, or
compare versions
But if that is the case we will need more information from you as to what you are chasing.
You can use the following code. You will see this code when you record a macro.
With ActiveWorkbook
.HighlightChangesOptions When:=xlAllChanges
.ListChangesOnNewSheet = False
.HighlightChangesOnScreen = True
End With
The questions is really what do you want to achieve. If you want to track changes in a spreadsheet, I assume you have some other users editing the workbook, and you want to record who changed what, as well as review/approve any modifications later on. Well, you don't actually need a triggering macros for that.
... instead of Track Changes, try comparing two workbooks using the Microsoft's Spreadsheet compare (application is limited to Excel 2013, Excel 2016 , Office 365 Professional).
... instead of Track Changes, you can record history of changes made to the workbook (who changed what and when) - XLTools Version Control.
I use both depending on the task.

Resources