AdvancedFilter to Array

W

Witek

Hello,

I would like to optimase my code. Now I have this:
'
Dim rng1 As Range, c1 As Byte, c2 As Byte
Worksheets("sheet1").Select
Set rng1 = Range(Cells(1, 2), Cells(1, 2).End(xlDown))
rng1.AdvancedFilter xlFilterCopy, , Cells(1, 11), True
c1 = Cells(1, 1).CurrentRegion.Rows.Count

ReDim tblUniqueData(c1)
For c2 = 1 To c1
tblUniqueData(c2) = Cells(c2 + 1, 11)
Next councik2
Cells(1, 11).CurrentRegion.Clear

Is any way to made so?
Dim varArray() as String
varArray = _
rng1.AdvancedFilter xlFilterCopy, , Cells(1, 11), True
It's possible?

and next quastion:)
1) How to sort varArray without "Loop" or "For", I heard that it's
possible when dimmension is in Selection
2) How to get Unique Value (not only one field) from varArray?

Best Reg.
Witek

*** Sent via Developersdex http://www.developersdex.com ***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top