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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -