PDA

View Full Version : macro required



keilah
01-28-2008, 04:05 AM
HI expert
I am not a VBA guru, just in the process of learning. I am looking for some VBA coed to complete the following task as i need to auotmate the process, going forward.

The VBA code has to work by matching client data based in client id in two worksheets

1. worksheet 1 (column A2) Client ID
2. worksheet 2 (column A2) client ID
3. If the client id match then:
4. Select from worksheet 2 the following information and input to worksheet 1.
5. Select data from column c2, column d2, column e2, column f2.
6. Input the result to column column N2 worksheet 1

so the final data in worksheet 1 reads as follows:

ID (matched between the two worksheets) column n2 (data from point 5 separate by a comma).

Bob Phillips
01-28-2008, 04:26 AM
No need for VBA, you can do it with a formula.

In N2 on sheet2, use

=IF(ISNUMBER(MATCH(A2,Sheet1!A:A,0)),Sheet1!C2&","&Sheet1!D2&","&Sheet1!E2&","&Sheet1!F2,"")

and copy down.

keilah
01-28-2008, 04:29 AM
thanks,

for the feedback.