Excel 2007 - macros
Solved/Closed
Regina
-
Jul 14, 2011 at 04:30 AM
rizvisa1
rizvisa1
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Related:
- Excel 2007 - macros
- MS Excel 2007 Macro/Formula problem ✓ - Forum - Excel
- Macros to Delete Rows in Excel 2007 ✓ - Forum - Programming
- Macro or VB in Excel 2007 ✓ - Forum - Excel
- Spellnumber in rupees in excel 2007 ✓ - Forum - Office Software
- Spell number in excel 2007 indian rupees software download - Forum - Office Software
1 reply
rizvisa1
Jul 14, 2011 at 06:34 AM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
Jul 14, 2011 at 06:34 AM
you can do a sumif
Jul 15, 2011 at 04:20 AM
Jul 15, 2011 at 04:57 AM
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
Jul 15, 2011 at 06:06 AM
ItemRow1 = Cells(lRow, "A")
ItemRow2 = Cells(lRow + 1, "A")
to
ItemRow1 = UCase(Cells(lRow, "A"))
ItemRow2 = UCase(Cells(lRow + 1, "A"))