Sum total help

S

S

I have used `sum total` for cells A11 to A269 the total being in A271

The actual total should be 36 but it keeps showing zero. I have gone to
format cell and formatted as number but still no joy.


Any ideas what is wrong.Why it wont add?
thanks
 
D

Don Guillett

Maybe you don't have numbers. Try this

Sub fixmynums()
On Error Resume Next
For Each C In Selection 'Range("a11:a269")
C.NumberFormat = "General"
C.Value = CDbl(C)
Next
End Sub
 
S

S

Not sure what you mean by "Maybe you don't have numbers."
I have formatted all the cells to numbers, also tried general and also text.

What you have given me below I don`t really want to go in there as I will
screw up, out my depth, from my past experience.

I am hoping that maybe by formatting cells or checking unchecking something
I can get this to total properly.
 
S

S

Have emailed to you.

Thanks

Don Guillett said:
If desired, send your workbook to my address below

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 
D

Dave Peterson

Changing the format doesn't change the value in the cell.

You have to do more.
One way is to run that macro that Don wrote for you.
Another way is to edit|copy an empty cell
select the range to fix
edit|paste special|check add and values
 
D

Don Guillett

Sub fixmynums()
Application.ScreenUpdating = False

lr = Cells.SpecialCells(xlCellTypeLastCell).Row
On Error Resume Next
For Each c In Range("a1:q" & lr)
If Trim(Len(c)) > 0 And c.HasFormula = False Then
c.NumberFormat = "General"
c.Value = CDbl(c)
End If
Next

Application.ScreenUpdating = True
End Sub
 
S

S

Don,

Many thanks for your help and time, especially with the macro, it adds up
properly now.

regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top