Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi could anyone help. I need to calculate the total value of a range of cells, say B2:B10. Then place that total into another cell, say A1. I need to do this using VBA with placing or displaying formula in the sheet at any time. thanks in advance regards Kevin *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub addum()
Set r = Range("B2:B10") Count = 0 For Each rr In r Count = Count + rr.Value Next Range("A1").Value = Count End Sub -- Gary''s Student - gsnu200730 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could put
=sum(b2:b10) in A1 In code: with worksheets("sheet1") with .range("a1") .formula = "=sum(b2:b10)" 'convert to a value?? .value = .value end with end with Kev wrote: Hi could anyone help. I need to calculate the total value of a range of cells, say B2:B10. Then place that total into another cell, say A1. I need to do this using VBA with placing or displaying formula in the sheet at any time. thanks in advance regards Kevin *** Sent via Developersdex http://www.developersdex.com *** -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Here is a completely different approach: Sub Tot() [a1] = WorksheetFunction.Sum([B1:B12]) End Sub -- Cheers, Shane Devenshire "Kev" wrote: Hi could anyone help. I need to calculate the total value of a range of cells, say B2:B10. Then place that total into another cell, say A1. I need to do this using VBA with placing or displaying formula in the sheet at any time. thanks in advance regards Kevin *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
TOTAL OF A RANGE SHOULD BE | Excel Worksheet Functions | |||
Total A Range | Excel Worksheet Functions | |||
how to get a total to add up a range | Excel Worksheet Functions | |||
How do I get the total of a range of cells that are in another she | Excel Discussion (Misc queries) | |||
Range Total | Excel Programming |