excel - Trying to apply advanced filter using range as input from a dialog box? -
getting error in advanced filter line of code. object doesn't support property or method.
dim rng range set rng = application.inputbox(prompt:="select range or enter a1 notation:", type:=8) workbooks(filename).sheets("sheet1").rng.advancedfilter action:=xlfiltercopy, criteriarange:=range( _ "a1:a2"), copytorange:=range("a3"), unique:=false
you don't need define workbook , sheet that's being defined range when set range. change code:
rng.advancedfilter action:=xlfiltercopy, criteriarange:=range( _ "a1:a2"), copytorange:=range("a3"), unique:=false
Comments
Post a Comment