I get the following error when my macro runs the following line of code.
Here is the whole block of code that contains the above line.
Can anyone tell what I'm doing wrong here.
Thanks so much.
HTML:
If Range("AA:AA").Value = "NEW" Then
Here is the whole block of code that contains the above line.
HTML:
'Checks for new carrier lane
Range("AA7").Select
ActiveCell.FormulaR1C1 = _
"=IF(COUNTIF('Current Ranking'!C[-25],'Rate Comparison'!RC[-15])>0,1,""NEW"")"
Range("AA7").AutoFill Destination:=Range("AA7:AA" & LR), Type:=xlFillDefault
Calculate
Range("AA:AA").Select
Selection.copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Adds new lanes to proposed ranking sheet
Sheets("Rate Comparison").Activate
If Range("AA:AA").Value = "NEW" Then
Range("A6").Select
Range("A6").AutoFilter
Range("A6").AutoFilter Field:=27, _
Criteria1:="=New"
Range("A7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).copy
Sheets("Proposed Ranking").Select
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("C" & FinalRow + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Comparison").Select
Range("C7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).copy
Sheets("Proposed Ranking").Select
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("E" & FinalRow + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Comparison").Select
Range("D7:J7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).copy
Sheets("Proposed Ranking").Select
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("F" & FinalRow + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Comparison").Select
Range("Q7:R7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).copy
Sheets("Proposed Ranking").Select
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("Q" & FinalRow + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Comparison").Select
Range("B7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).copy
Sheets("Proposed Ranking").Select
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("O" & FinalRow + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Comparison").Select
Range("K7:L7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).copy
Sheets("Proposed Ranking").Select
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("A" & FinalRow + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Comparison").Select
Range("A6").AutoFilter
End If
Can anyone tell what I'm doing wrong here.
Thanks so much.