Summing a Column

S

Stuart

If a col is formatted as Number (to 2 decimal places)
but there are empty cells in the column, how do I avoid
a #VALUE? error when I sum the range with
=SUM("A2:A60") say, please?

Regards.
 
F

Frank Kabel

Hi
if the cells are really empty the SUM formula should work without any
problems. Are there formulas in the cells A2:A60?
 
S

Stuart

Thanks.

You were correct <g>. The formulae result from a programmatic
paste into the range in question.

It's obviously not the correct ng, but I guess I had better stick to this
thread.

I'm moving data with code, and then returning control to the user, so
that they can use their required formula on the range. I therefore need
to move values only.

Here's an example of the type of code I have used:
Workbooks(wkbkname).Sheets("SUMMARY").Activate
.Range("B65536").End(xlUp).Offset(0, 7).Resize(1, 3).Copy _
Destination:=Workbooks(ExcludeBook). _
Sheets("GENERAL SUMMARY").Range _
(TargetAddress).Offset(2, 7)

Can this be amended easily, or do I need to find another way to
achieve the copy/paste, please?

Regards.

Frank Kabel said:
Hi
if the cells are really empty the SUM formula should work without any
problems. Are there formulas in the cells A2:A60?
 
C

CLR

Take the quotation marks out of the formula, as.........

=SUM(A2:A60)

Vaya con Dios,
Chuck, CABGx3
 
M

mudraker

you can always do a paste special. values



Workbooks(wkbkname).Sheets("SUMMARY").Activate
.Range("B65536").End(xlUp).Offset(0, 7).Resize(1, 3).Copy

Workbooks(ExcludeBook).Sheets("GENERAL SUMMARY").Range _
(TargetAddress).Offset(2, 7).PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=Fals
 
S

Stuart

Many thanks all.

Regards.

mudraker > said:
you can always do a paste special. values



Workbooks(wkbkname).Sheets("SUMMARY").Activate
Range("B65536").End(xlUp).Offset(0, 7).Resize(1, 3).Copy

Workbooks(ExcludeBook).Sheets("GENERAL SUMMARY").Range _
(TargetAddress).Offset(2, 7).PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
 

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