Excel Macro using Visual Basic - Newbie

adieaw1983 - Oct 28, 2008 at 05:16 AM
 foxtrothound - Aug 12, 2010 at 11:59 AM
Hello all,

I'm a complete newbie to macro's and am hoping there is someone out there generous enough to offer some help, because I'm confused!

Basically I am trying to work through a list with several hundred entries, I need to find the corresponding value in another worksheet in the same workbook. I want to search the second worksheet "Total" using the values in cell "A2" from the original worksheet "Active" (going down the column as I progress). I would then like to copy the results from the same row as the result but in column E and paste that into the "Active" worksheet in cell "F2".

I've been trawling through books and sites and so far I've come up with the below, but this may be way off the mark:

Sub 1()

Worksheets("Active Vs Blank").Activate
Worksheets("Total Enrolments").Activate
Cells.Find(What:=Paste, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
'Need to move to the column E in the same row
ActiveSheet.Paste Destination = Worksheets("Active Vs Blank").Range("F2")
End Sub

Any help would be greatly appreciated, even if it's just the title of books/sites that could help, and of course I will provide more info if needed.

Thanks in advance


1 response

i would use the vlookup function in excel.