Excel Weight Loss Tracker in Stone

In January, you read about the Excel Weight Loss Tracker in which you could enter your current height and weight, and record your weekly weight loss. That version was in pounds.

A couple of people asked about a stone/pound version, so I’ve finally created one — just in time for swimsuit season!

Continue reading “Excel Weight Loss Tracker in Stone”

Add a Macro Button to the Excel QAT

As part of the Excel programming series, I described how to run an Excel macro by adding a button to the Quick Access Toolbar (QAT).

Video: Add Macro Button to QAT

If you use a macro frequently, you can add its icon to the Quick Access Toolbar (QAT). There are written instructions below the video

Add Macro Button to QAT

In this example, there is a macro named ToggleR1C1. that I use frequently. The macro toggles the worksheet reference style from letters (A1 style) to numbers (R1C1 style)

The ToggleR1C1 macro is stored in my Personal Macro Workbook, which is named Personal.xlsb.

  • Tip: Further down this page, there’s a video that shows how I recorded and edited the ToggleR1C1 macro

To add that macro to the QAT, I followed the steps below.

  • First, at the right end of the QAT, click the drop down arrow
  • Click More Commands

Excel Options Window

When the Excel Options window opens, the Customize category, at the left, is automatically selected.

  • In the window pane at the right, near the top, click the drop down arrow for the “Choose commands from” setting
  • In the drop down list, click on Macros

Select a Macro

  • Next, in the list of macros, click the PERSONAL.XLSB!ToggleR1C1 macro
    • PERSONAL.XLSB is the file name for the Personal Macro Workbook
  • Then click the Add button, to move the selected macro to the Quick Access Toolbar

Choose Macro Button Icon

Next, follow these steps to add a picture (icon) to the Macro button

  • At the right, in the QAT list, click the PERSONAL.XLSB!ToggleR1C1 macro
  • Next, below the list, click the Modify button
  • When the Modify Button dialog box opens, look for an icon will remind you of what your macro does.
  • Next, click on the icon you want to use for the macro
    • I used the 8-ball, because the macro switches headings from letters to numbers, or vice versa.
  • Then, click the OK button, to close the Modify Button dialog box
  • And finally, click the OK button, to close the Excel Options window

Use the Macro Button

When you’re back in Excel, the macro icon now appears on the QAT.

When you want to run your macro, just click its icon on the QAT.

New I can I click the 8 Ball icon, when I want to toggle the worksheet reference style from letters (A1 style) to numbers (R1C1 style)

Video: Record & Edit Macro to Toggle Styles

Watch this video, to see how to record your own macro, to change between R1C1 style (column numbers) and A1 style (column letters). Then, add a button for the macro on the Quick Access Toolbar.

Video: Add Excel Options to QAT

If you use the Excel Options window frequently, you can add a command to the Quick Access Toolbar, to open that window quickly.

In this video, I show how to turn off the Excel Option Boxes, with a setting in the Excel Options window. Next, I show how to add an Options command to the QAT, so the window opens with a specific tab activated

More Quick Access Toolbar Tips

Visit my Contextures site for more tips for using the Quick Access Toolbar with your macros, such as adding QAT buttons that run macros for a specific workbook only.

___________

Excel VBA Edit and Test a Macro

writeicon In the Excel VBA Edit a Recorded Macro article, you saw the steps for making changes to an Excel macro that you had recorded.

The original range was 50 rows, and I increased both references, to make them each 500 rows.

Excel VBA code edited

Video: Edit & Test Excel Macro

I’ve uploaded a new video that shows the steps for editing the Excel macro, and stepping through the macro code by using the F8 key.

The full transcript is below the video

Video Transcript

I recorded a macro in Excel and now we’d like to make a little change to that macro and test it.

Here’s the workbook where I store the macro

And to get started, there’s a security warning here.

I’m going to click Options and click, Enable this content, and OK

Now the macros will run.

See Macro Code

To see that macro, I’ll go to the Developer tab, click Macros

Select my macro in the list, and click Edit

That opens the Visual Basic Editor, and I can see all the workbooks that are open.

Most of these are hidden and just working in the background, but here’s the workbook where I recorded and stored the code.

And those are the sheets, and here’s the module where the code is stored

See Recorded Macro Steps

In this macro, I can see all the steps that were recorded.

  • It opens a workbook
  • Goes to a sheet
  • Range A1 on that sheet
  • Turns on an AutoFilter
  • Filters for Binders
  • Selects range A1 to J50
  • Copies it
  • Adds a new workbook
  • And pastes what we copied

The change I want to make is just making this a bit bigger range.

  • Right now, it’s going to row 50, which is where the orders stop now
  • I know that I’ll be adding more orders every month, so I’m going to change the 50 to 500

Change the Code and Save

I’ll change it there, and in the next line of code, that also had a 50

I’ve made the change, and to save that, I’ll go up to the toolbar, and click the Save button

Test Revised Macro

Now, to test this revised macro:

  • I’m going to just click somewhere between the Sub, and the End Sub row
  • I’ll click here, and on the toolbar, I’ll click Debug
  • There’s a Step Into command, and the keyboard shortcut is F8
  • I’ll click Step Into, and it highlights the first row in the macro
  • I’ll press F8 on the keyboard, and that takes me down to the first line of code, which is Workbooks.Open

It’s highlighting the row in the code that it’s about to run

  • When I press F8, it opens that workbook, and moves down to the next line of code

Here’s the workbook in the background now

  • And it will go to the Data sheet
  • I press F8, and it was already on the Data sheet, so nothing happened
  • Then it’ll go to range A1, and turn on the AutoFilter
  • I press F8 again, and you can see the filter arrow there now

The next line of code tells it to filter for Binder orders

  • So F8, and now you can see the row numbers are blue, and some rows are hidden, so the filter has been applied
  • Now it will select A1 to J500, when I press F8
  • Then it copies, and F8 again, to add a new workbook

And you can see the blank sheet in the background now

  • And now it will paste when, I press F8
  • And I’m at the last row here, so when I press F8 again, it’ll just take me out of the macro

We have made a revision to the macro, we saved it, tested the macro, and it works fine.

We can just close our macro workbook now, and know that our revised macro works fine

____________

Track Golf Scores in Excel Annual Statistics

golficon I’d need wider columns to hold my golf scores, but this Excel template for golf scores might help you keep track of your annual progress.

template to keep track of your annual golf scores
template to keep track of your annual golf scores

Annual Summary

There’s also an annual summary sheet, that calculates your average score and best score for the year.

golfscores01c

Conditional Formatting for Scores

The golf scores template uses conditional formatting to highlight the holes where you shot par or below par, so you can see at a glance how things are going.

You enter the course pars on the Summary sheet, and the conditional formatting is on the Scores sheet.

golfscores01d

Name the Cell

Because conditional formatting won’t allow you to refer to cells on another sheet, I named cell B8 as CoursePar, and use that name in the conditional formatting formulas.

For example, the formula for par is:

  • =B2=OFFSET(CoursePar,0, COLUMN()-1)

golfscores04

Download the Golf Scores Template

To download the Golf Scores template, go to the Excel Template – Golf Scores page on my Contextures website.

he zipped Excel workbook does not contain any macros — Excel formulas so all the work, after you enter the scores.

More Golf With Excel

If you’re organizing a golf tournament, you can organize the tee off times with another one of my Excel Golf templates.

Go to the Golf Tee Off Times page on my Contextures site, to download the Excel workbook.

The video below shows how the Tee Off Times file works.

______________

Dynamic Excel Named List Grows Automatically

You can quickly create a named range in Excel, but it doesn’t automatically expand to include new items that are added at the end of the list.

However, a dynamic Excel named list grows automatically, so here’s how to create that type of list.

static list doesn't automatically expand to include new items
static list doesn’t automatically expand to include new items

Continue reading “Dynamic Excel Named List Grows Automatically”

Keep Track With Excel Count Functions

Lots of people visit my Contextures website looking for information on the Excel Count functions.

Counting seems like an easy thing to do in Excel, if you’ve been using the program for a while. But, if you’re just starting out, it might not be so obvious.

Count Quirks

Even if you’re an experienced Excel user, there are a few quirks with the Count functions, that you might not have noticed yet.

For example, different count functions treat “empty” cells differently, as you can see in the screenshot below.

  • In Row 5, the blue cells contain a formula that creates an empty string.
  • The COUNTA function counts that cell, even though it looks empty.
  • The COUNTBLANK function counts the cell too, even though it contains a formula.

countempty

Watch the Video

To see the Excel Count functions that count numbers only, any data, or blank cells, you can watch this short video.

More Excel Count Function Examples

There are many more tips, examples and videos on the Excel Count functions page on my Contextures site.

Video: 7 Ways to Count in Excel

To see a quick overview of 7 ways to get a total count of cells in Excel, watch this 77-second video. There are written steps for each count function on the Excel Count functions page.

_______

Count Items in List with Excel Pivot Table

If you have a long list of items, you could use formulas to count how many times each item occurs in the list.

It would take a few steps, including pulling a list of unique items from the list, then creating a formula to count each item. Is there an easier way?

Continue reading “Count Items in List with Excel Pivot Table”

Save Space With Pivot Table Subtotals

When you summarize data in a pivot table, it usually shows a sum of the values. (If there are blanks or text values in the field, usually the pivot table shows a count instead.)

In this pivot table, you can see the total labour cost for each Service Type.

pivotsubtotal00

If there are two or more fields in the Row or Column area, subtotals are automatically created for all the fields except the last one.

In the screenshot below, the District field was added below the Service Type field. Subtotals were automatically added to Service Type.

pivotsubtotal01

Change the Summary Function

Instead of seeing the Sum of the data, you can change the summary function, and show the Average, or any of the other options. You could even put the same field in the Values area of a pivot table multiple times, and use different summary functions in each column.

In this example, the sum of the labour cost is shown in column C, and the Max function is used in column D.

Subtotals for Sum and Max
Subtotals for Sum and Max

Change the Subtotal Summary Function

If your pivot table already has lots of columns, you might not want to make it wider, by adding another copy of one of the Value fields.

Instead, you can change the summary function for the Subtotal, so it uses a different function than the Value fields.

Now the Value fields show the sum of labour costs, and the subtotal for each service type shows the highest labour cost that was charged for that service.

You can see the maximums, without adding extra columns to the pivot table.

pivotsubtotal02

More Info on Pivot Table Subtotals

You can read more about pivot table subtotals, and the steps for changing them, on the Contextures website: Excel Pivot Table Subtotals.

Watch the Pivot Table Subtotals Video

To see the steps for changing the pivot table subtotals, and creating multiple subtotals, you can watch this short video.

_____________

How to Create Excel Pivot Table from Multiple Sheets

If Excel data is on different sheets, you can create a pivot table from multiple sheets, by using multiple consolidation ranges. My video, further down this page, shows you the steps.

Of course, it’s better if the data is all on one sheet. But, if you don’t have that option, the multiple consolidation ranges will pull all the data into one pivot table.

Continue reading “How to Create Excel Pivot Table from Multiple Sheets”

Copy Data From Browser to Excel

Instead of copying and pasting, you can quickly copy data from a web browser to Excel, by dragging and dropping.

Video: Copy Web Data to Excel

To see the steps in action, you can watch this 30 second video. The full transcript is below the video.

Video Transcript

If you want to copy something from a web browser, into Excel, you can just drag and drop

On my website, I’m just going to scroll down a little, and select some text, and links, and graphics

Then, just point anywhere, even if it’s the clicking hand

Instead of clicking, we’re going to just drag over here to Excel

Let go, and it copies the links, the text, the graphics, and you’re ready to go!

___________