ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   command button to calculate two cell values? (https://www.excelbanter.com/excel-programming/332927-command-button-calculate-two-cell-values.html)

sunil5

command button to calculate two cell values?
 

Hi,

Probably an easy one for most...

I've got a command button and I would like it so when I press it, i
calculates the values in cells "D8" and "D9" and puts the total i
"D10"


Any help would be much appreciated.

Thanks

--
sunil
-----------------------------------------------------------------------
sunil5's Profile: http://www.excelforum.com/member.php...fo&userid=1361
View this thread: http://www.excelforum.com/showthread.php?threadid=38248


Tom Ogilvy

command button to calculate two cell values?
 
Private Sub CommandButton1_Click()
Range("D10").Value = Range("D8").Value + _
Range("D9").Value
End Sub

--
Regards,
Tom Ogilvy


"sunil5" wrote in
message ...

Hi,

Probably an easy one for most...

I've got a command button and I would like it so when I press it, it
calculates the values in cells "D8" and "D9" and puts the total in
"D10"


Any help would be much appreciated.

Thanks.


--
sunil5
------------------------------------------------------------------------
sunil5's Profile:

http://www.excelforum.com/member.php...o&userid=13614
View this thread: http://www.excelforum.com/showthread...hreadid=382482




anilsolipuram[_114_]

command button to calculate two cell values?
 

In the design mode double click the button

and paste this code

Private Sub CommandButton1_Click()
Range("d10").Value = Range("d8").Value + Range("d9").Value
End Sub


--
anilsolipuram
------------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
View this thread: http://www.excelforum.com/showthread...hreadid=382482


sunil5[_2_]

command button to calculate two cell values?
 

Oh thanks for that- i was trying to use the Range command but not
properly.

Cheers again :)


--
sunil5
------------------------------------------------------------------------
sunil5's Profile: http://www.excelforum.com/member.php...o&userid=13614
View this thread: http://www.excelforum.com/showthread...hreadid=382482



All times are GMT +1. The time now is 01:54 PM.

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