by correctly, i meant the sum showed in the cell, not the formulaworks correctly for me
i just pasted your code into my ide and set a range to suit
by correctly, i meant the sum showed in the cell, not the formulaworks correctly for me
i just pasted your code into my ide and set a range to suit
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed![]()
pete
Hi Seenu,
I got below error:
Run-time error '1004':
Method 'Rows' of object '_Global' failed
Code:Sub calculateSubtotalOfRows(sRange As String, sumRowEnd As Integer) Dim i As Integer For i = 1 To sumRowEnd sumRowEnd = Cells(Rows.count, i).End(xlUp).Row Cells(sumRowEnd + 1, i) = WorksheetFunction.SUM(range(Cells(1, i), Cells(sumRowEnd, i))) Next End Sub
Value of sRange = B11:R11
Value of sumRowEnd = 20
Hi Ria,
which line gives error? can u attach the file u tried?
Seenu
If this post is useful, pls don't forget to Rate this post.
Pls mark thread as resolved once ur problem solved.
ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms