Hi guys,
This is my code as followed,
There is a compile Else If error when I try to loop it. Not sure how to debug.
This is my code as followed,
Code:
Sub Macro3()
' Macro3 Macro
Sheets("MV filter").Select
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MV-70%").Select
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("MV-70%").Select
Range("C4").Select
Do Until IsEmpty(ActiveCell)
If Range("C4") <> "" Then
Sheets("MV-70%").Select
Range("A4:C4").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("MV-70%").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("MV-70%").Sort.SortFields.Add Key:=Range("C5:C2674" _
), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("MV-70%").Sort
.SetRange Range("A4:C2674")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
Sheets("MV-70%").Select
Range("A4:C4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Sheet3").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("MV-70%").Select
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
Range("C4").Select
Else
Sheets("MV-70%").Select
Range("A4").Select
End With
Application.ScreenUpdating = False
End Sub
There is a compile Else If error when I try to loop it. Not sure how to debug.
Last edited by a moderator: