Addition using Visual Basic - Help!

Tomkinson

New Member
Joined
Sep 3, 2011
Messages
2
I would like to place a number into a cell and have it be added to a running total in another cell when you click a button.
So say you type a number into B3, once you click the 'button' it takes that number and adds it on to the number already in C3 and clears cell B3. Anyone know how to do this? Felt like it would be simple task but it's been too long since I last used VB it would seem... :confused:
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Try assigning this to a button

Code:
Sub AddC3()
Range("C3").Value = Range("C3").Value + Range("B3").Value
Range("B3").ClearContents
End Sub
 
Upvote 0
Try assigning this to a button

Code:
Sub AddC3()
Range("C3").Value = Range("C3").Value + Range("B3").Value
Range("B3").ClearContents
End Sub

Thank you very much, I knew it would be simple. Too many beers since College had washed it from my mind. :)
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,671
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top