Sumif cell has a boarder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a spreadsheet with a column that has cells with
totals and cells with just numerical data. Each cell that
I want to total has a boarder around it. Is there anyway
that I can Sum If a cell has a boarder?

(Using the Subtotal function will not work in this case.)

Thanks for your help!
N
 
If indeed the data is either just plain numbers or sum formulas, one way
would be to select the column,
press F5, click special, select formulas, copy, then paste somewhere else,
this way you can paste them onto a new sheet, then just sum the whole
column, then subtract the
formulas that you copied somewhere else, i.e.

=SUM(D1:D95)-SUM(Sheet2!A1:A10)

where D1:D95 is the total of the range and sheet2 A1:A10 holds the totals.
 
You may have to modify to suit your borders but try this

Sub sumborders()
For Each c In [d9:d12]
If c.Borders(xlEdgeLeft).LineStyle > 0 _
Then mysum = mysum + c.Value
Next
MsgBox mysum
End Sub
 
Back
Top