Monday 15 August 2011

vba - Matching and inserting records in excel -


I have two sheets of data: one sheet has a primary ID with 4 fields, and the second with 2 fields with the primary field Are there.

  The name of sheet a sheet b id value type category id's name value 1s normal 2 australia 500 2nd default 1 ind 400  

actually i Both sheet IDs need to be matched and the name and value of the sheet need to be copied. I have tried the following code,

  all copy () lastrowA = task sheet ("Sheet A"). Room (rows.kount, "A"). End (XLEEP) .ro + 1 set RNGA = range ("A2" and "previous") lastrowB = worksheet ("SheetB"). Room (rows.kount, "A"). End (XLEEP) .Ro + 1 set RNGB = Range ("A2" and last BO) For every x in RNGA for each y, if x value () = y.Value then copy the name of the paste and the value form B. From A to End Next Next End Sub  

This is the name of your macro There is not a good idea to use the reserved word in particular, if you plan to use a , then the Mac Copy operation within programming.

  Sub Microphysi () with at least worksheets ("Sheet A") - lastrowA = Room (rows.kount, "A"). End (XLEEP). With Ryan. ("B2: C" and previous AO). Formula = "= Ifror (Valuqueup ($ A2, 'Sheet B'! $ A: $ C, Columns (B: B), FALSE)," "" Value =.  

The bulk displays the entire area with the appropriate area, without changing it, converts the returned values ​​into raw values. Any non-mail # N / A will be empty instead of errors.


No comments:

Post a Comment