ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to add in increments for multiple cells (https://www.excelbanter.com/excel-worksheet-functions/106130-how-add-increments-multiple-cells.html)

MaggieV

How to add in increments for multiple cells
 
Hi, to keep this question simple.....what I'd like to be able to do is to
create a macro that will add an increment of 1 to the existing number in
multiple selected cells (example: if i have a2, a17, a20, a21, and a40
selected, I want to add 1 to their existing sum - none will have the same
resulting sum).

Thanks!
MaggieV

Toppers

How to add in increments for multiple cells
 
Try:

I created a named range called "Increment" which holds value to be added.
Select cells to adjusted and call macro

Sub Add_Incr()
Dim incr as Double
incr = Range("Increment")
For Each cell In Selection
cell.Value = cell.Value + incr
Next
End Sub

HTH

"MaggieV" wrote:

Hi, to keep this question simple.....what I'd like to be able to do is to
create a macro that will add an increment of 1 to the existing number in
multiple selected cells (example: if i have a2, a17, a20, a21, and a40
selected, I want to add 1 to their existing sum - none will have the same
resulting sum).

Thanks!
MaggieV



All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com