excel - Using advanced filter with criteria -


i trying copy distinct values excel table vba, running in trouble when want assing criteria it.

i trying filter values bigger 0 in column ci

this code work

dim keycells range set keycells = range("h1")             if not application.intersect(keycells, range(target.address)) _            nothing     dim lastrow long     lastrow = activesheet.range("h1").value application.enableevents = false     sheets("fond16").range("c4:c31").clear     sheets("plnenioperatoru_2016").range("b" & lastrow - 1 & "11:b" & lastrow & "11").advancedfilter _     action:=xlfiltercopy,  _     copytorange:=sheets("fond16").range("c4"), _     unique:=true 

but not work (will throw 1004: application-defined or object-defined error)

sheets("plnenioperatoru_2016").range("b" & lastrow - 1 & "11:b" & lastrow & "11").advancedfilter _ action:=xlfiltercopy, criteria:="ci>0", _ copytorange:=sheets("fond16").range("c4"), _ unique:=true 

i love know if can somehow rephrase criteria parameter make working. in advance :)

edit:i trying use code, in criteria range

ci >0 

and show first value, first value 0 in ci column criteria not work

sheets("plnenioperatoru_2016").range("b" & lastrow - 1 & "11:b" & lastrow & "11").advancedfilter _     action:=xlfiltercopy, criteriarange:=sheets("2016").range("x1:x2"), _     copytorange:=sheets("fond16").range("c4:c31"), _     unique:=false 


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -