Advertisement
YasserKhalil2019

T4501_Sort Multiple Tables Using SpecialCells Areas

Jan 19th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. https://excel-egy.com/forum/t4501
  2. ---------------------------------
  3.  
  4. Sub Sort_Multiple_Tables_Using_SpecialCells_Areas()
  5. Dim myAreas As Areas, i As Long
  6.  
  7. Set myAreas = Columns("A").SpecialCells(2).Areas
  8.  
  9. For i = 1 To myAreas.Count
  10. With myAreas(i).Cells(2).Resize(myAreas(i).Count - 1, 11)
  11. .Sort Key1:=.Cells(6), Order1:=xlAscending, Header:=xlYes
  12. End With
  13. Next i
  14. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement