Unique text formula question in excel
Solved/Closed
Related:
- Unique text formula question in excel
- Formula to calculate vat in excel - Guide
- Number to words in excel formula - Guide
- Date formula in excel dd/mm/yyyy - Guide
- Grade formula in excel marksheet - Guide
- Logitech formula vibration feedback wheel driver - Download - Drivers
1 response
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