Unique text formula question in excel
Solved/Closed
Related:
- Unique text formula question in excel
- EXCEL: Nested IF formula question ✓ - Forum - Excel
- Unique id formula in excel ✓ - Forum - Excel
- How to show or hide formula bar in Excel: VBA, shortcut - Guide
- Grade formula in ms excel - Guide
- Formula across sheets excel - Guide
1 reply
It will first sort on the name who added, then by date and then by client. If you want to see it back in old sort order, you can add rows number to each row before and once macro is done, re-sort of the row number. But if sort is nothing big, then u can use it as is
Cells.Select
Selection.Sort _
Key1:=Range("B2"), Order1:=xlAscending, _
Key2:=Range("C2"), Order2:=xlAscending, _
Key3:=Range("A2"), Order3:=xlAscending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
lrow = 2
AddedByName = Cells(lrow, 2)
addCount = -1
Do While Cells(lrow, 1) <> ""
If (AddedByName <> Cells(lrow, 2)) Then
addCount = -1
AddedByName = Cells(lrow, 2)
End If
addCount = addCount + 1
Cells(lrow, 4) = addCount
lrow = lrow + 1
Loop
Cells.Select
Selection.Sort _
Key1:=Range("B2"), Order1:=xlAscending, _
Key2:=Range("C2"), Order2:=xlAscending, _
Key3:=Range("A2"), Order3:=xlAscending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
lrow = 2
AddedByName = Cells(lrow, 2)
addCount = -1
Do While Cells(lrow, 1) <> ""
If (AddedByName <> Cells(lrow, 2)) Then
addCount = -1
AddedByName = Cells(lrow, 2)
End If
addCount = addCount + 1
Cells(lrow, 4) = addCount
lrow = lrow + 1
Loop