Dim x
X= inputbox(“請輸入查詢編號”)
Sheets(“a”).select
Selection.autofilter
Selection.autofilter filed:=2, criterial:=x
Range(“a1”).select
Range(selection,activecell.specialcells(xllastcell)).select
Selection.copy
Sheets(“b”).select
Range(“a1”).select
Selection.pastespecial paste:=xlvalues,operation:=xlnone,skipblanks:=true,transpose:=false