Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hello, I'm trying to sum certain cells in macro, however, the cell range is
not fixed;(i.e cells are based on variables) Herebelow is an example of the macro but it's giving an error at the sum funtion (would appreciate if you could help me find the mistake): Sub R() Dim i As Integer, x As Integer, y As Integer, z As Integer For i = 2 To 15 y = i - z x = i - 1 Cells(i, "H").Formula = "=Sum(Cells(y, "H"), Cells(x, "H"))" z = 0 y = 0 x = 0 Next i End Sub Thank you |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing a range name as an argument to the Index Function | Excel Discussion (Misc queries) | |||
Function to remove a space from text in cell WITHOUT macro?? | Excel Worksheet Functions | |||
clock | Excel Worksheet Functions | |||
Function to determine if any cell in a range is contained in a given cell | Excel Worksheet Functions | |||
Returning a Value to a Cell Based on a Range of Uncertain Size | Excel Worksheet Functions |