Can someone help me to solve my little problem.
I have 2 sheets, RPN & FMA. I'm making a VBA codes in sheet RPN.
I am in RPN sheet and want to go to sheet FMA. I want to sort it according some criteria, then copy first 10 rows, come back to sheet RPN again, and paste the copied fields.
The problem is when i start sorting the fields in FMA, it gives me an error. Why?
here is my program:
Sheets("RPN").Select
.
.
.
Sheets("FMA").Select
cursht = ActiveSheet.Name
LastRow = ActiveSheet.Range("B65536").End(xlUp).Row
ActiveSheet.Rows("11:" & LastRow).Select
Selection.Sort Key1:=Range("G11"), Order1:=xlAscending, Key2:=Range("B11" _
), Order2:=xlAscending, Key3:=Range("C11"), Order3:=xlAscending, Header _
:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom _
, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
xlSortNormal
ActiveSheet.Range("B11:C20").Select
Selection.Copy
Sheets("RPN").Select
Range("C10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
I have 2 sheets, RPN & FMA. I'm making a VBA codes in sheet RPN.
I am in RPN sheet and want to go to sheet FMA. I want to sort it according some criteria, then copy first 10 rows, come back to sheet RPN again, and paste the copied fields.
The problem is when i start sorting the fields in FMA, it gives me an error. Why?
here is my program:
Sheets("RPN").Select
.
.
.
Sheets("FMA").Select
cursht = ActiveSheet.Name
LastRow = ActiveSheet.Range("B65536").End(xlUp).Row
ActiveSheet.Rows("11:" & LastRow).Select
Selection.Sort Key1:=Range("G11"), Order1:=xlAscending, Key2:=Range("B11" _
), Order2:=xlAscending, Key3:=Range("C11"), Order3:=xlAscending, Header _
:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom _
, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
xlSortNormal
ActiveSheet.Range("B11:C20").Select
Selection.Copy
Sheets("RPN").Select
Range("C10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False