Please help - Find & copy Macro

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!
 
J

JCS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top