Getting Data From Sheet

S

slideman

Hey,
I made an invoice system that generate invoices.
I did it in excel, and now I want to do it as macro.
So far it going good to me, but I have problem.
I have a sheet that his name is "Comapny Info".
I need that when I put the name of the company in the cell, it will ge
details from the sheet.
I need it to work like Vlookup, but not with the Vlookup function.
Give an exmple:
Col A is company name - That I want to find.
after i find to name i want to take from col B and Col C the contac
name and from col B and phone from Col C.

Thanks for your help,
SlideMan
 
T

Tom Ogilvy

Turn on the macro recorder and go to the Company Info sheet. Then do
Edit=>Find and enter the company name.

After it finds the company name, then turn off the macro recorder. You can
now generalize the code to pass it the name of a company to find and remove
the select and activate commands so you get a reference to the found cell.
Now you can use that with Offset to retrieve the information you need.
 
T

tolgag

SlideMan,

Attached is an example. I hope it does, what you need.
There may be a need of small changes, to make it do exactly what you
want.
It's quite a simple macro. The only thing, which may put you in some
trouble (if you're not experienced in programming) is the logical
pointer.

Attachment filename: searchinvoicesexample.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=420318
 
Top