How to get values in Excel from the column where value equals to the specific number? -
i have 2 sheets, in first - data. in second want show values want. like: if value column "b" of 1st sheet = 1, show values column c , d in 2nd sheet.
here need select values equals, example "503" in column l, , show them in 2nd sheet.
how can this?
or here's little code snippet of comparing 2 sheets cells, same of different (up you) , if match, place them in sheet 2's column l1 :
sub test() dim value1 string dim value2 string value1 = thisworkbook.sheets(1).range("a1").value 'sheet 1 value value2 = thisworkbook.sheets(2).range("b1").value 'sheet 2 value if value1 = value2 thisworkbook.sheets(2).range("l1").value = value1 'or 2 else msgbox ("values not match!" + vbnewline + vbnewline + "'" + value1 + "'" + "does not match '" + value2 + "'.") end if end sub
if want tweak liking, change sheet 1's value, or sheet 2's, call.
happy coding :)
Comments
Post a Comment