This one might be a little odd, but I’m working around a system already in place and am looking for a way to improve without restructuring data.
What I have is a spreadsheet with the following columns and data structure. apologies for the formatting I wasn’t sure how to better explain a spreadsheet on here.
LocalizationPackId | TextValue | PageId | TargetId | ApplicationId
1 | xxx | 1 | AA1 | 1
1 | xxx | 1 | AB1 | 1
2 | xxx | 1 | AA1 | 1
2 | xxx | 1 | AB1 | 1
3 | xxx | 1 | AA1 | 1
The real sheet of course has hundreds of entries in each in each LocalizationPack. What I am looking for is a technique to verify that any unique entry of PageId + TargetId + ApplicationId that is contained within LocalizationPackId = 1 also contains a mirror entry in all subsequent localization packs.
In the example above I would want the MACRO to when ran check for any missing values. It would see that in LocalizationPack 1 there is a value 1/AB1/1, and then check the other packs for that value. Then it would find that LocalizationPack 3 is missing 1/AB1, and create a row mirroring the original row from LocalizationPack 1, except with the correct LocalizationPackId, and TextValue = “NEEDS LOCALIZATION”. Also the newly created row would ideally be highlighted in red.
I don’t have any experience with macros, but I know C# fairly well. Can someone help me get started on this or point me to a guide that would demonstrate the techniques required to accomplish something like this?
I’d start with identifying the missing localisation packs with a formula, rather than a macro. If LocalizationPackId is in cell A1, the other labels are in row 1 and the data start in row 2, then a suitable formula for row 2 would be:
… which could then be copied down for all the relevant rows (I’ve taken the formula to row 1000 but it could easily go as far as you want).
(EDIT)
Here’s what it looks like in my spreadsheet, with the formula above in column G:
(END OF EDIT)
The result of this formula is a negative number aligned with each combination of PageId, TargetId and ApplicationId that shows how many versions of this localisation are missing from packs after the one where it is first introduced.
It won’t tell you which pack the localisation is missing from, but a
=COUNTIF()to tell you the number of localisations that are present in each pack would point you in the right direction.You could automate the search to define exactly which localisation is missing from each pack with VBA but, if you’re not doing this very often, writing and debugging the VBA code might be more hassle than it is worth. The
=COUNTIFS()formula above would provide an automated and continual assurance that there are no localisations missing.If you are doing this often, then the
=COUNTIFS()column would be a good start for the VBA code to automate that process.