View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Set values in an Array

I didn't test this, so it may not work...

Dim myArr as variant

with worksheets("nameofsheetwithlist")
myarr = .range("a1",.cells(.rows.count,"A").end(xlup)).val ue
end with

'then your code
activesheet.listobjects("list12559").range.autofil ter field:=1, _
criterial:=myarr, operator:=xlfiltervalues



jlclyde wrote:

Is there a way to load an array with data from a worksheet? Here is
the code I have.

ActiveSheet.ListObjects("List12559").Range.AutoFil ter Field:=1,
Criteria1:= _
Array("103", "113", "123", "213", "220", "227", "231", "235",
"290", "500", _
"540", "900"), Operator:=xlFilterValues

These values are in A1-A12. I am hoping to make this more dynamic so
when I add a criteria I can just add it to the sheet and not to the
sheet and the VBA macro.

Any help woudl be appreciated,
Jay


--

Dave Peterson