Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how do i make a button that adds
two ranges together i.e adds a1 to c1, a2 to c2 etc.. and places these values in the "a" column where the previous values were thanks for the help |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use code like the following:
Dim Rng As Range For Each Rng In Range("A1:A10") Rng.Value = Rng.Value + Rng(1, 3).Value Next Rng Change the A1:A10 to the appropriate range. I " wrote in message ... how do i make a button that adds two ranges together i.e adds a1 to c1, a2 to c2 etc.. and places these values in the "a" column where the previous values were thanks for the help |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub AddValues()
Dim cell as Range if Selection.Columns.count 1 then exit sub if selection.Column < 1 then exit sub for each cell in selection if isnumeric(cell.value) and isnumeric(cell.offset(0,2).Value) then cell.Value = cell.Value + offset(0,2).Cell.Value end if Next End Sub select the cells in column A that you want to update and run the macro. You can also manually select the column of contiguous cells in column C, then do Edit=Copy, then select the first cell in column A and do Edit=Paste Special and select Values and Add. -- Regards, Tom Ogilvy " wrote in message ... how do i make a button that adds two ranges together i.e adds a1 to c1, a2 to c2 etc.. and places these values in the "a" column where the previous values were thanks for the help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding Non-Contiguous Ranges | Excel Discussion (Misc queries) | |||
adding ranges | Excel Discussion (Misc queries) | |||
adding two ranges | Excel Programming | |||
adding named ranges | New Users to Excel | |||
Adding ranges | Excel Programming |