Thread: adding columns
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default adding columns

Public Sub ProcessData()
Dim i As Long, j As Long
Dim LastRow As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To LastRow

If Application.CountIf(.Columns("A"), .Cells(i, "A").Value) 1
Then

For j = 2 To 4

.Cells(i, j).Value = Application.SumIf(.Columns("A"),
..Cells(i, "A").Value, .Columns(j))
Next j
End If
Next i

For i = LastRow To 1 Step -1

If Application.CountIf(.Columns("A"), .Cells(i, "A").Value) 1
Then

.Rows(i).Delete
End If
Next i
End With

End Sub

--
__________________________________
HTH

Bob

"Masterzan" wrote in message
...
I have a sheet that I basically need to summarise - however it has various
columns that need to be summarised eg.

Checker. cases. overs.shorts
amy .100.1.0
peter.25.2.3
jack.56.4.1
amy.10.3.6

I need to summarise to show:

Checker. cases. overs.shorts
amy.110.4.6

Thanks

Claire