Forum Discussion

gray_b365's avatar
gray_b365
Copper Contributor
Mar 20, 2025

Why does SUM not work for me ??

My worksheet has been generated by VBA from another master worksheet. By filtering data, and copy/paste.

I am using office 365, and a simple =SUM(A2:A4) of 3 numbers (5,10,5) on that page does not work.

It just displays 0.00

All the cells are formatted as a number.

Any ideas please 

  • In addition, applying number format to texts which looks like numbers changes nothing. You may check what actually you have with ISNUMBER() or ISTEXT()

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    I suspect your macro pasted texts in stead of numbers. Then SUM will indeed will return zero.

    • gray_b365's avatar
      gray_b365
      Copper Contributor

      I think the pasting was the problem.

      But that leads me onto. How do I format the data in the paste operation or cell formatting to be a 'number' when pasted in VBA ?

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

Resources