Related:
- Excel Formula
- Excel grade formula - Guide
- Number to words in excel formula - Guide
- Date formula in excel dd/mm/yyyy - Guide
- Logitech formula vibration feedback wheel driver - Download - Drivers
- Excel mod apk for pc - Download - Spreadsheets
2 responses
kingsjay
Posts
17
Registration date
Saturday August 23, 2008
Status
Member
Last seen
July 2, 2009
3
Feb 4, 2009 at 06:45 AM
Feb 4, 2009 at 06:45 AM
hi,
try this link and see if this software can solve your problem:
https://www.rocketdownload.com/query.php?q=excel+macro+sum+workbook
try this link and see if this software can solve your problem:
https://www.rocketdownload.com/query.php?q=excel+macro+sum+workbook
Assumptions for this code:
1) You have already sorted column A (by Name) as you stated.
2) There are no empty cells within column A of your 10,000 rows of data.
This code will check for duplicate Names in column A, and then sum column C values and column D values while
deleting the duplicates to leave just one unique Name with the totals as you stated.
Private Sub AddQuantities()
Dim i
i = 2
Do Until IsEmpty(Range("A" & i))
dup = i + 1
Do While Range("A" & i) = Range("A" & dup)
Range("C" & i) = Range("C" & i) + Range("C" & dup)
Range("D" & i) = Range("D" & i) + Range("D" & dup)
Rows(dup).EntireRow.Delete Shift:=xlUp
Loop
i = i + 1
Loop
End Sub
1) You have already sorted column A (by Name) as you stated.
2) There are no empty cells within column A of your 10,000 rows of data.
This code will check for duplicate Names in column A, and then sum column C values and column D values while
deleting the duplicates to leave just one unique Name with the totals as you stated.
Private Sub AddQuantities()
Dim i
i = 2
Do Until IsEmpty(Range("A" & i))
dup = i + 1
Do While Range("A" & i) = Range("A" & dup)
Range("C" & i) = Range("C" & i) + Range("C" & dup)
Range("D" & i) = Range("D" & i) + Range("D" & dup)
Rows(dup).EntireRow.Delete Shift:=xlUp
Loop
i = i + 1
Loop
End Sub
Sorry, use this instead. I did not have the code totaling the unique value left for columns C & D.
Dim i
Dim tot
Dim tot2
i = 2
Do Until IsEmpty(Range("A" & i))
dup = i + 1
Do While Range("A" & i) = Range("A" & dup)
Range("C" & i) = Range("C" & i) + Range("C" & dup)
Range("D" & i) = Range("D" & i) + Range("D" & dup)
Rows(dup).EntireRow.Delete Shift:=xlUp
Loop
tot = tot + Range("C" & i)
tot = tot + Range("D" & i)
i = i + 1
Loop
Dim i
Dim tot
Dim tot2
i = 2
Do Until IsEmpty(Range("A" & i))
dup = i + 1
Do While Range("A" & i) = Range("A" & dup)
Range("C" & i) = Range("C" & i) + Range("C" & dup)
Range("D" & i) = Range("D" & i) + Range("D" & dup)
Rows(dup).EntireRow.Delete Shift:=xlUp
Loop
tot = tot + Range("C" & i)
tot = tot + Range("D" & i)
i = i + 1
Loop