Excel 2007 - macros
Solved/Closed
Regina
-
14 Jul 2011 à 04:30
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 15 Jul 2011 à 06:06
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 15 Jul 2011 à 06:06
Related:
- Excel 2007 - macros
- Save as pdf office 2007 - Download - Other
- Excel online macros - Guide
- Excel mod apk for pc - Download - Spreadsheets
- Microsoft picture manager download 2007 - Download - Image viewing and management
- Unlock excel vba and excel macros - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
14 Jul 2011 à 06:34
14 Jul 2011 à 06:34
you can do a sumif
15 Jul 2011 à 04:20
15 Jul 2011 à 04:57
Sub Disk1()
Dim lRow As Long
Dim ItemRow1, ItemRow2 As String
Columns("A:B").Select
Selection.Copy
Sheets("Sheet1").Select
Range("A1").Select
ActiveSheet.Paste
Cells.Select
Selection.Sort _
Key1:=Range("A2"), Order1:=xlAscending, _
Key2:=Range("B2"), Order2:=xlDescending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
lRow = 2
Do While (Cells(lRow, 1) <> "")
ItemRow1 = Cells(lRow, "A")
ItemRow2 = Cells(lRow + 1, "A")
If (ItemRow1 = ItemRow2) Then
Cells(lRow, "B") = Cells(lRow, "B") + Cells(lRow + 1, "B")
Rows(lRow + 1).Delete
Else
lRow = lRow + 1
End If
Loop
End Sub
15 Jul 2011 à 06:06
ItemRow1 = Cells(lRow, "A")
ItemRow2 = Cells(lRow + 1, "A")
to
ItemRow1 = UCase(Cells(lRow, "A"))
ItemRow2 = UCase(Cells(lRow + 1, "A"))