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
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
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
"[email protected]" <[email protected]> wrote in message
news:[email protected]...
> 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
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
"[email protected]" <[email protected]> wrote
in message
news:[email protected]...
> 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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks