Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Entering Sum formula into a cell
Parker
Here's one way to do it: Sub Test() 'Leo Heuser 29 Sept. 2003 Dim DataColumn As String Dim DestCell As Range Dim EndRow As Long Dim StartRow As Long StartRow = 1 EndRow = 6 DataColumn = "A" Set DestCell = Range("B7") DestCell.Formula = "=SUM(" & _ Range(DataColumn & StartRow).Address & _ ":" & Range(DataColumn & EndRow).Address & ")" End Sub -- Best Regards Leo Heuser MVP Excel Followup to newsgroup only please. "Parker" skrev i en meddelelse ... I am having trouble entering a sum formula from a macro into a cell. I have defined variables called 'StartRow' and 'EndRow' and I want to enter a sum formula for column N from 'StartRow' to 'EndRow' into the active cell. I don't know how to incopropate the variables into the sum formula. Any help would be greatly appreciated. Thanks in advance! Parker |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Entering Formula - Cannot select cell as it is hidden by formula | Excel Worksheet Functions | |||
Warning when in another cell after entering a formula. | Excel Worksheet Functions | |||
entering a formula into a cell with text | Excel Discussion (Misc queries) | |||
How to protect cell with formula from being entering info | Excel Worksheet Functions | |||
Entering Sum formula into a cell | Excel Programming |