Hello All,
I am trying to calculate the sum for range of row and column values, which I am passing dynamically through for-loop. My code is as follow as :
Dim Total as Long
Total = WorksheetFunction.Sum(Range(ThisWorkbook.Sheets("Sheet1").Cells(startrow, x): ThisWorkbook.Sheets("Sheet1").Cells(endrow, x))))
The above code didn't throw any error, however Total returned zero values,while the sheet1 have valid values and the sum shouldn't be zero. The Range of start and end row I am passing dynamically and x - represents column I am incrementing through For-loop. (Also verified through MsgBox that start/endrow fetching the correct rows).So could you please help me to fix this issue.
Thanks in Advance!
Bookmarks