vba - Match fields in two different Excel Sheets -


so have 1 excel file multiple sheets in it, how can match fields sheet1 column , sheet2 column b if names match add name sheet3?

basically have students in sheet1 , sheet2 different criteria, want find duplicates sheet1 , sheet2 , throw duplicates on sheet3.

also similar question: how can find name in column b , change value else in column c. example:

column b     column c sam          ziva jen          tiva leo          miva 

so if name sam exists in column b want name ziva in column c tried simple if statement looks 1 field.

something work. or can replace inner loop vlookup per comment.

dim idx1 integer dim idx2 integer dim idx3 integer idx1 = 2 idx3 = 1 while sheets("sheet1").range("a" + cstr(idx1)).value <> ""      idx2 = 2     while sheets("sheet2").range("b" + cstr(idx2)).value <> ""         if sheets("sheet1").range("a" + cstr(idx1)).value = sheets("sheet2").range("b" + cstr(idx2)).value             idx3 = idx3 + 1             sheets("sheet3").range("c" + cstr(idx3)).value = sheets("sheet1").range("a" + cstr(idx1)).value         endif         idx2 = idx2 + 1     wend     idx1 = idx1 + 1 wend 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -