View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
jlclyde jlclyde is offline
external usenet poster
 
Posts: 410
Default Set values in an Array

On Dec 7, 1:36*pm, jlclyde wrote:
On Dec 7, 12:51*pm, jlclyde wrote:





On Dec 7, 12:01*pm, Dave Peterson wrote: 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


Dave, This did not work. *I get subscript out of range. *Any other
thoughts? *I am sure this is possible and I have been playign with it
all morning to no avail.
Thanks,
Jay


Dave,
I was wrong.....Your code works fine when I am pointing at the right
list. *That is why I was gettign the error.

Thanks for the help,
Jay- Hide quoted text -

- Show quoted text -


Dave,
I was wrong again....Here is the code I ahve and it is sorting th
ecorrect list it just does not leave nay value on the screen. I am
not sure what is goign on here is my code.
Jay
Sub Macro3()
Dim MyArray As Variant
With Sheet4
MyArray = .Range("A5", .Cells(5, .Range("A5").End
(xlToRight).Column)).Value
End With

Sheet5.ListObjects(1).Range.AutoFilter Field:=1, Criteria1:= _
MyArray, Operator:=xlFilterValues
End Sub