excel - Loop through two columns on one sheet, find corresponding unique row on another sheet, and return value in third column -


i have columns , b in sheet ("reference") contain criteria. want macro loop through these criteria, through columns , b in sheet ("pages"), find unique corresponding row, , return value in third column of sheet if it's not blank.

below have tried far, doesn't return value:

    each in sheetrng        each j in proprng           dim x long, lr long, flag boolean          lr = range("a" & rows.count).end(xlup).row          x = 3 lr              if range("a" & x) = "theo caliber" , range("b" & x) = , range("c" & x) = j , not isempty(range("d" & x))                  flag = true                  exit              end if          next x           dim y integer          y = rows(2).find(what:="total marketing", lookin:=xlvalues, lookat:=xlwhole, matchcase:=false).column           dim z variant          set z = cells(x, y)            thisworkbook.activate          sheets("total rated").range("b67").value = 6          sheets("total rated").exportasfixedformat type:=xltypepdf, _          filename:="c:\users\mercolani\desktop\2015\by department\" & z & ".pdf", _          openafterpublish:=false         next j     next 

any soul out there knows doing wrong?

thanks!


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -