Advertisement
Guest User

Untitled

a guest
May 31st, 2013
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub design_sort()
  2. '
  3. ' design_sort Macro
  4. '
  5.    Sheets("Status Tracking").Select
  6.     Dim LastColumnInRow2 As Variant
  7.     LastColumnInRow2 = Cells(2, Columns.Count).End(xlToLeft).Column
  8.     Range(Cells(2, 3), Cells(9, LastColumnInRow2)).Select
  9.     Selection.Copy
  10.     Sheets("DESIGN_SORT").Select
  11.     Range("C2").Select
  12.     Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
  13.         False, Transpose:=False
  14.     Sheets("Status Tracking").Select
  15.     Range(Cells(10, 2), Cells(16, LastColumnInRow2)).Select
  16.     Application.CutCopyMode = False
  17.     Selection.Copy
  18.     Sheets("DESIGN_SORT").Select
  19.     Range("B10").Select
  20.     Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
  21.         False, Transpose:=False
  22.     Range(Cells(2, 2), Cells(16, LastColumnInRow2)).Select
  23.     Application.CutCopyMode = False
  24.     ActiveWorkbook.Worksheets("DESIGN_SORT").sort.SortFields.Clear
  25.     ActiveWorkbook.Worksheets("DESIGN_SORT").sort.SortFields.Add Key:=Range( _
  26.         Cells(14, 4), Cells(14, LastColumnInRow2)), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
  27.         xlSortNormal
  28.     With ActiveWorkbook.Worksheets("DESIGN_SORT").sort
  29.         .SetRange Range(Cells(1, 4), Cells(17, LastColumnInRow2))
  30.         .Header = xlGuess
  31.         .MatchCase = False
  32.         .Orientation = xlLeftToRight
  33.         .SortMethod = xlPinYin
  34.         .Apply
  35.     End With
  36. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement