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

rholdren

Board Regular
Joined
Aug 25, 2016
Messages
140
Office Version
  1. 365
  2. 2019
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
 
Do you have any blank cells in col E?
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,214,827
Messages
6,121,823
Members
449,049
Latest member
cybersurfer5000

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
Back
Top