Forum Discussion
gray_b365
Mar 20, 2025Copper Contributor
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 w...
Riny_van_Eekelen
Mar 20, 2025Platinum Contributor
I suspect your macro pasted texts in stead of numbers. Then SUM will indeed will return zero.
gray_b365
Mar 20, 2025Copper 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 ?
- HansVogelaarMar 21, 2025MVP
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?