Excel Macro to Increase Amount in Multiple Cells

Every morning, I use Excel to keep track of the projects I’m working on, and organize my tasks for the day. Of course, things don’t always go as planned, but it helps to know where I’m headed!

Project Work List

In my project workbook, I record the time spent on yesterday’s tasks, and then plan today’s tasks.

One column has dates, so:

  • I move some tasks a day forward, if they weren’t finished.
  • I move weekly tasks 7 days ahead, so they’re in the plan for next week.

To save time, instead of typing the revised dates, I use those little macro buttons at the top of column E:

  • Select a date cell
  • Click the +7 macro button to add 7 days
    • or click +1 macro button to add 1 day

Then, after everything is moved forward, I click the Sort button, to put things in the updated order.

addnumbermacrobuttons01

Choose Number of Days to Add

If you do anything similar, you can get my macros to add numbers to worksheet cell values.

There’s a macro that adds a specific number, like my +1 and +7 macro buttons do

Or, use my macro that prompts you to enter a number, and the value in each selected cell is increased by that amount.

This screen shot shows the sample file’s macro button, and the input box.

The four selected cells will increase by 100, and all the other cells will stay the same.

addamount03

Video: Add Numbers to Multiple Cells in Excel

To see how my macros work, and how you can modify the code slightly, watch this 5-minute video.

  • The video starts by showing how to change multiple cells manually, with the Paste Special command.
  • After that, you’ll see how the macros work, and how to change a couple of lines in the macro code.

Video Timeline

  • 00:00 Introduction
  • 00:33 Manually Add Number
  • 01:23 Macro 1: Add Specific Number
  • 02:07 Macro 2: Prompt for Number
  • 02:44 See the Macro 2 Code
  • 03:22 Modify the Macro Code
  • 04:14 See the Macro 1 Code
  • 04:34 Macro Buttons
  • 04:52 Get the Sample File

Download the Sample File

To see how the macros work, and get the code to use in your own Microsoft Excel worksheet, you can visit my Contextures website.

You’ll find the instructions and sample file on the Add Number to Multiple Cells page.

The zipped file is in xlsm format, and contains macros. Enable macros when you open the file, if you want to test the code.

______________________________

Excel Macro to Increase Amount in Multiple Cells

Excel Macro to Increase Amount in Multiple Cells

______________________________

Original source: https://contexturesblog.com/archives/2023/02/23/excel-macro-to-increase-amount-in-multiple-cells/?utm_source=rss&utm_medium=rss&utm_campaign=excel-macro-to-increase-amount-in-multiple-cells

Close Menu