
It is not as easy to pick up as Applescript, but Office's automation is entirely built around Visual Basic. If you do the same operations on data with identical formatting, use recorded macros. This example can save you a couple of steps, but for more complex actions that can add up. Your macro should be highlighted, click run to add your sums and averages. Once you have another sheet of data, go back to Developer and click Macros. Your macro is now able to use on each new sheet you add to your workbook. Then, paste that into the cells in rest of the column. Then in the next cell down, enter =Average(B2:F2). Then in the header add Average after the last column. Then copy and paste that into the rest of the columns. In the cell next to it, enter =SUM(B2:B10). Click okay to start setting up the macro.Īt the bottom of the hourly listings enter Daily Totals. You can enter a description if you need more details on what the macro does. In the dialog enter the name as AverageandSum and leave it stored in This Workbook. (If you don't have data to populate this sheet, you can enter =RandBetween(10,1000) in all the cells to create dummy data.) Next, click on Developer in the Ribbon. Then fill out your sales data for the day. Your sheet should match the screenshot above.Īdd a new tab, and copy your template into it. I used 24-hour time, but you can use AM/PM notation if you prefer. Then in the first column put a break down of hourly totals from 8-5. Across the top add Monday through Friday. Using this first blank as a template to copy into a new tab each day could save you some time. If you work in retail or other sales position, this is a helpful sheet to track revenue. Your macro is going to add a daily sales total, and then add an average in the last column of each hourly period. Click on your macro name and click Run to run your recorded actions.Įxample 1: Daily Sales Total and Hourly Averageįor an example macro, you are going to run through a daily sales sheet, with the sales broken down by hourly totals. Clicking macros will bring up the saved macros in your workbook. Once you record your actions, they are available on this same tab. The Personal Macro Workbook is in your user profile and lets you use your macros between your files. You can scope your macro to the Current Workbook, a New Workbook, or in your Personal Macro Workbook. Click this, and a dialog pops up allowing you to name your macro and set a keyboard shortcut. Your previously missing column A magically reappears.You're looking for the third option in the Ribbon, Record Macro. When your mouse pointer changes to this special double-headed arrow, all you have to do is right-click and choose Unhide. It is different, however, because instead of a black line dividing the double arrows, there are two black lines with a gap between them. This double-headed arrow is a bit difficult to describe it looks most closely like the double-headed arrow that appears when you position the pointer over the dividing line between column headers. If you move your mouse pointer into the column header area, and then slowly move it to the left, you notice that it turns into a double-headed arrow with a blank spot in the middle as you position the pointer over the small area immediately to the left of the column B header. You can then choose Column from the Format menu and then choose Unhide.Ī third method is even niftier, provided you have a good eye and a steady mouse pointer. If you release the mouse button when the pointer is over the gray block that marks the intersection of the row and column headers (the blank gray block just above the row headers), then column B and everything to its left, including the hidden column A, are selected. Choose Column from the Format menu, then choose Unhide.Īnother way to display the first column is to click on the header for column B, and then drag the mouse to the left.Cell A1 is now selected, even though you cannot see it on the screen. In the Reference field at the bottom of the dialog box, enter A1.Choose Go To from the Edit menu, or press F5.To unhide the left-most columns of a worksheet when they are hidden, follow these steps: If you later want to unhide column A, the solution isn't so obvious. For instance, if you hide column A, Excel will dutifully follow out your instructions.

What isn't so easy is displaying a hidden column if that column is the left-most column in the worksheet.

Excel makes it easy to hide and unhide columns.
