Ive seen some similar things here but nothing quite like this . The following code below works fine as long as I have an alpha value in the range I'm looking for but will not do the same if i have a numeric value.
What I am trying to do is to copy and paste a line if the numeric value that is entered by the user is found in the column. If I change one of the values to be something alpha like dog it will work. However if I change dog back to 1234 it will not copy and paste the line. To make it more interesting, if I replace the = with a < or a > it will copy the header but not the row with the value in it. Any thoughts?
Application.ScreenUpdating = False
Dim Dollar_Move As Variant
'Opening Dialog
Dollar_Move = InputBox("Enter the lowest dollar amount to be move (This will move the entered amount and everything larger")
'
MsgBox Dollar_Move & " $$$ DOLLARS AND OVERE IS BEING MOVED TO THE REPORT PAGE"
Sheets("Build_Page").Select
Last = Cells(Rows.Count, "E").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "E").Value) = Dollar_Move Then
Cells(i, "A").Select
Cells(i, "A").EntireRow.Copy
Sheets("Report").Select
Range("a2:I5000").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
Next i
What I am trying to do is to copy and paste a line if the numeric value that is entered by the user is found in the column. If I change one of the values to be something alpha like dog it will work. However if I change dog back to 1234 it will not copy and paste the line. To make it more interesting, if I replace the = with a < or a > it will copy the header but not the row with the value in it. Any thoughts?
Application.ScreenUpdating = False
Dim Dollar_Move As Variant
'Opening Dialog
Dollar_Move = InputBox("Enter the lowest dollar amount to be move (This will move the entered amount and everything larger")
'
MsgBox Dollar_Move & " $$$ DOLLARS AND OVERE IS BEING MOVED TO THE REPORT PAGE"
Sheets("Build_Page").Select
Last = Cells(Rows.Count, "E").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "E").Value) = Dollar_Move Then
Cells(i, "A").Select
Cells(i, "A").EntireRow.Copy
Sheets("Report").Select
Range("a2:I5000").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
Next i