Sitemap
Crystal X

Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

Create a blood sugar report with Excel VBA

3 min readSep 19, 2026

Because I have type 2 diabetes, I must check my blood glucose level every day. I keep all of my blood glucose readings in a small lined book and don’t do a lot with that information. If the reading is high on a day, I reflect upon what I had eaten the previous day.

I thought it would be a good idea to put my blood glucose readings over the past three months into a chart to see if I could pick out a trend.

I have written a program in Excel VBA to enable me to create a report of my glucose readings with the click of one button.

Get Crystal X’s stories in your inbox

Join Medium for free to get updates from this writer.

The program I have written in Excel VBA performs the following tasks:-

  1. Creates a new sheet in Excel to present the report.
  2. Assigns a title to the report in cell A1.
  3. Create a table of the blood glucose readings with the dates those readings were taken, starting at cell A3.
  4. Create a dataset of descriptive statistics, starting at cell D2.
  5. Create a line chart of the blood glucose levels and the dates they were taken.

In order to create this chart, it was first necessary to enter the date the blood glucose level was taken and the reading, which can be seen in the sheet below. In addition, I have also put a button on the sheet that the user only needs to click onto in order to run the report:-

Press enter or click to view image in full size

When the button to run the program is clicked onto, the module named blood_sugar_report is automatically activated:-

The module below is the code for the program that I have written:-

Press enter or click to view image in full size
Press enter or click to view image in full size

When I clicked the button to run the report, a new sheet was created and the below report was instantaneously created, to include:-

  1. Title if the report
  2. Table with the data copied from the active sheet
  3. Small table listing statistics
  4. Line chart plotting the blood glucose readings by date
Press enter or click to view image in full size

The chart above indicates that my blood glucose levels are increasing, so I need to take greater care in my diet.

I was so impressed with this program that I am going to see how I can incorporate the code in the reports that I must prepare in my day job.

I have created a code video to accompany this blog post and it can be viewed here:- https://youtu.be/0vRIhruND-Y

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.