Sub Macro1()
'
' Macro1 Macro
'
'
Application.ScreenUpdating = False
Sheets("Sheet1").Select
Range("B2:E21").Select
Selection.Copy
Range("G2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("I2:I21") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("G2:J21")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A1").Select
Sheets("Sheet2").Select
Range("A2").Select
ActiveCell.FormulaR1C1 = "=IF(AND('Sheet1'!RC[12]>0,'Sheet1'!RC[12]<>""""),'Sheet1'!R1C2,"""")"
Range("B2").Select
ActiveCell.FormulaR1C1 = "=IF(AND('Sheet1'!RC[11]>0,'Sheet 1'!RC[12]<>""""),'Sheet1'!RC[5],"""")"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=IF(AND('Sheet1'!RC[10]>0,'Sheet1'!RC[12]<>""""),'Sheet1'!RC[5],"""")"
Range("D2").Select
ActiveCell.FormulaR1C1 = "=IF(AND('Sheet1'!RC[9]>0,'Sheet 1'!RC[12]<>""""),'Sheet1'!RC[5],"""")"
Range("E2").Select
ActiveCell.FormulaR1C1 = "=IF(AND('Sheet1'!RC[8]>0,'Sheet1'!RC[12]<>""""),'Sheet1'!RC[5],"""")"
Range("A2:E2").Select
Selection.AutoFill Destination:=Range("A2:E25"), Type:=xlFillDefault
Range("A2:E25").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("H14").Select
Application.CutCopyMode = False
Range("A2:E25").Select
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Add Key:=Range( _
"A2:A25"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Add Key:=Range( _
"D2:D25"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Add Key:=Range( _
"B2:B25"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Add Key:=Range( _
"C2:C25"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Sheet2").Sort
.SetRange Range("A2:E25")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A2:E25").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("F1").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("Sheet1").Select
Range("G2:J21").Select
Selection.ClearContents
Range("A1").Select
Sheets("Sheet2").Select
Range("G6").Select
ActiveCell.FormulaR1C1 = "=IF(R[-4]C[-6]="""",""NONE!!"","""")"
Range("G6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Thanks guys
Bookmarks