Include "Starts with" in VB Array

I've got a line in a VB script that currently reads:

ActiveSheet.Range("$A$1:$DD$500").AutoFilter Field:=6, Criteria1:=Array( _ "0a", "1b", "s", "t", "ss"), Operator:=xlFilterValues

Open in new window


I need to add to this line to have it include in the array the existing items plus anything in Field 6 that begins with a "z".  I understand that to determine whether a string starts with "z" I can do this:

Result = String1 Like "z*"

Open in new window


But could somebody explain to me how I could incorporate that result into the array?  Thanks!
Dan CarpIT DirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rgonzo1971Commented:
Hi,

pls try
Sub Macro()
Set objDict = CreateObject("Scripting.Dictionary")
For Each c In Range(Range("F1"), Range("F500"))
    If Not objDict.Exists(c.Value) And c Like "z*" Then objDict.Add c.Value, c.Value
Next
strList = Join(objDict.Items, ",") & ",0a,1b,s,t,ss"
aList = Split(strList, ",")
ActiveSheet.Range("$A$1:$DD$500").AutoFilter Field:=6, Criteria1:=aList, Operator:=xlFilterValues
End Sub

Open in new window

Regards
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dan CarpIT DirectorAuthor Commented:
Thanks Rgonzo1971 - appreciate the clarity of your script.  Will hold onto these steps for future needs.  Cheers!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.