Please help - Find & copy Macro

  • Thread starter Thread starter Damil4real
  • Start date Start date
D

Damil4real

Please help -

Macro to find "E4" value in column A. If found, copy found value from
the A column and paste in cell A5.

All info are in sheet named is List.

Thanks!
 
Hi,

Try the following code: I'm assuming you know hw to inser this code into a
VBA module. This also assumes that there are no blanks in column A.

Sub FindValue()
Dim CellValue As Variant
Dim i As Variant

CellValue = Range("e4").Value
Application.ScreenUpdating = False
Range("e5").ClearContents
Range("a1").Select

For i = 1 To Range("a1").End(xlDown).Row

If ActiveCell().Value = CellValue Then
Selection.Copy
Range("E5").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Else
ActiveCell.Offset(1, 0).Select

End If

Next i
Application.ScreenUpdating = True
Range("a1").Select
End Sub

John
 
Back
Top