copy and paste doesn't work when cell value is a number

rholdren

Board Regular
Joined
Aug 25, 2016
Messages
88
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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
52,755
Office Version
  1. 365
Platform
  1. Windows
Do you have any blank cells in col E?
 

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Watch MrExcel Video

Forum statistics

Threads
1,122,239
Messages
5,595,002
Members
413,958
Latest member
SBM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top