Important note: Please see the comments—the method I discuss here is secure from casual users. However, the Excel files are just zipped XML files, so it's possible to unzip them and open them with a text editor. When I tested with my dummy salary worksheet, I could see individual salary values, but no actual text—so there wasn't any way to associate a salary with a person. Still, the following should be considered as only a semi-safe solution.
My wife wants to create a budget spreadsheet for the various departments in her company to use. Each department would have their own tab, showing their planned yearly budget by month for the coming year. A super-simplified and unrealistic input worksheet might look like this:
The green areas are the portions that the users would fill out—probably not the department heads, but just someone in the department. Which leads to the problem: There's a worksheet called Salary Info that's used to populate the Salaries line in the workbook. (In my silly example, I just divided the total salary into four equal quarters.)
The problem is that the Salary Info worksheet contains salary information for the entire organization, and this isn't information that should be shared with everyone.The Salary Info sheet might reveal, for instance, that a coworker is leaving in three months—the coworker has told management, but the employee isn't ready to tell the entire company just yet.
So how can you distribute the workbook to all the departments, with the salary info intact, but without revealing that data to everyone?
At the end of 2016, I first posted about my run tracking Excel workbook. That first version was crude, but functional, and I used it to track every mile of my "2,016 miles in 2016" running goal. I posted a minor revision for 2017, then made some major updates for 2018. When 2019 rolled around, I made a few more changes, which I released by way of a note added to the 2018 post.
Now that 2020 is here—I know, it's a bit past January, sorry!—I've made yet more changes, and have decided it's time to replace both of the previous posts with one new all-in-one post. Here you'll find a link to the latest version of the workbook, as well as full instructions on how to use it.
I use Excel for a ton of stuff, both personal and work. As an example, on the work side I use an Excel workbook to track our apps' hidden prefs—which are set using a long ugly Terminal command1Something like this: defaults write com.manytricks.Moom "PMWindowFadingDuration" -float 0.
These hidden prefs can be used to invoke features we're testing, or to revert a behavior we've changed at some point, etc. For example, Moom has hidden prefs to use the full screen grid without clicking in the big box and to disable the fade in/out of the keyboard controller.
We don't publish all of these, as we're not necessarily ready for them to be put to use by everyone (otherwise, they'd be visible prefs). But there are cases when a user has a specific need for a setting, or when troubleshooting, that these hidden prefs can be very useful. As such, I often have to send someone a defaults write command.
Read on to see how I use Excel's formatting features—plus the ever-valuable Keyboard Maestro—to disguise some of this workbook's formula results, yet still easily copy them for sending to a user.
I recently explained how to use the keyboard in Excel's Paste Special dialog box, and this is a great timesaver on its own. But I use Paste Special a lot, especially with Formats, Formulas, and Values, so I made those three even easier to use via the keyboard…
Each one has its own direct keyboard shortcut, courtesy of Keyboard Maestro. Here's how I set it up; these instructions should work (with some changes, of course) for any app that can script keystrokes.
First, I created these macros in an Excel group, so they're only active when Excel is frontmost (no need to create global hot keys that you only use in one program). The actual macros are pretty trivial:
- Send Command-Control-V to bring up the Paste Special dialog
- Pause just long enough for the dialog to appear onscreen
- Send the chosen shortcut key—T, F, or V in my vase
- Send the Return key to execute the action
Then I just assigned each one to the same key used within the dialog, but with Command and Option to make it usable from anywhere within Excel.
When I'm working in Excel, I spend a lot of time in the Paste Special dialog box—pasting formulas, pasting all but formats, pasting only formats, etc. You can call up the dialog with a keyboard shortcut (⌃⌘V), but it then looks like you're stuck using the mouse, because there aren't any keyboard shortcuts for the various actions. But really, there are…
(Note: This applies to the current version of Excel, i.e. the one in Office 365. Based on the comments, it apparently also works in Excel 2011 if you add the Command key.)
On Excel for Windows, one character in each option has an underline, indicating that option's keyboard shortcut. The good news is that these same shortcuts work on the Mac, even though they're not shown. (There is one apparent oversight: The O key should select Operation: None, but it doesn't seem to work on the Mac.)
Here are all the shortcuts, graphically:
Press the highlighted key, and that action will be selected; press Return to execute the chosen command, and you can use the Paste Special dialog without ever touching the mouse. (Note that the Paste Link action executes immediately when chosen, so it's a one-key operation.)
Because graphics are horrid for web searching, the text version of each shortcut, in alphabetical order, is shown below.
This morning, while working on a customer request, I had to create a list of words by randomly choosing words from two lists, and then mashing them together. This isn't something that I've ever done before, and I'm not sure how relevant it might be for others, but I'm documenting it here just in case someone is searching for such a solution.
Here's how my little test spreadsheet looked when I was done with it:
I didn't realize it at the time, but this could be a "modern paint color" name generator…"Yes, I'd like two gallons of the Pickle-Purple, please." Anyway, the COMBINED column contains the final result, with the FOODS and COLORS columns showing randomly-selected entries from the two lists. Each time you recalculate the sheet, all the selections will change.
The key bit is the formula to grab a random entry from the list; here's what that looks like in cell C12 ("Apple"):
It's just a basic VLOOKUP that uses RANDBETWEEN to grab a random row from the lookup table. Not rocket science, but nothing I'd tried before. (For this to work, your table entries need row numbers, obviously.) The COMBINED column is just a simple text formula, i.e. =C12&"-"&F12 to combine the two random values.
I also wasn't aware of the RANDBETWEEN function—it returns a whole number between the values you specify. That is so much easier than using RAND and then having to multiply and round off, etc.
Feel free to download the workbook if you'd like to take a look.