Good morning,
I have Office 365 Excel and seem to be having a little issue with the scrip below. It runs extremely slow and it is only pulling the first record over and stopping. The script should be reading down column AX and and wherever it finds 3% should copy the entire row and move it to another worksheet.
Any help on this would be greatly appreciated.
Thanks
Sub Create_List()
Application.ScreenUpdating = False
Sheets("OptumRxExport").Select
Last = Cells(Rows.Count, "AX").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "AX").Value) = "3%" Then
Cells(i, "AX").Select
Cells(i, "AX").EntireRow.Copy
Sheets("Discounted_List").Select
Range("a2:I50000").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.PasteSpecial Paste:=xlPasteValues
ActiveCell.PasteSpecial Paste:=xlPasteFormats
End If
Sheets("OptumRxExport").Select
Next i
End Sub
I have Office 365 Excel and seem to be having a little issue with the scrip below. It runs extremely slow and it is only pulling the first record over and stopping. The script should be reading down column AX and and wherever it finds 3% should copy the entire row and move it to another worksheet.
Any help on this would be greatly appreciated.
Thanks
Sub Create_List()
Application.ScreenUpdating = False
Sheets("OptumRxExport").Select
Last = Cells(Rows.Count, "AX").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "AX").Value) = "3%" Then
Cells(i, "AX").Select
Cells(i, "AX").EntireRow.Copy
Sheets("Discounted_List").Select
Range("a2:I50000").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.PasteSpecial Paste:=xlPasteValues
ActiveCell.PasteSpecial Paste:=xlPasteFormats
End If
Sheets("OptumRxExport").Select
Next i
End Sub