View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ctwobits ctwobits is offline
external usenet poster
 
Posts: 2
Default Lookup - copy.paste values macro?

I would like to use vlookup in a macro. I have a simple form in excel that
looks up information in a database. I wrote a simple macro that copies that
copies the information into another tab dropping down each time and then
refilling the formulas to pull data back from the database.

I need to be able to have my macro lookup into the database and overwrite
the original row based on the name.

How do I write a vlookup into a macro?

""Sheets("Fill Db").Select
Range("b2:bf2").Select
Selection.Copy
Here is where I would like it to lookup (vlookup) based on the name in b2
from the sheet above find it in the sheet below and then copy value the
line.
Sheets("Final Database").Select
Range("b2:b250").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
Sheets("FillForm").Select
Range("c1:h1").Select
Selection.Copy
Sheets("Profile Sheet").Select
Range("c1").Select
ActiveSheet.Paste
Sheets("FillForm").Select
Range("a2:h37").Select
Selection.Copy
Sheets("Profile Sheet").Select
Range("a2").Select
ActiveSheet.Paste""

Any help is greatly appreciated.

TIA
C