Filtering based on partial filename

jordanburch

Active Member
Joined
Jun 10, 2016
Messages
440
Office Version
  1. 2016
Hey all I have the below code

VBA Code:
ActiveSheet.Range("$A$1:$AF$100000").AutoFilter Field:=21, Criteria1:= _
        "=CO21army" & Left(ThisWorkbook.Worksheets("Variables").Range("a8").Value, 3) & Right(ThisWorkbook.Worksheets("Variables").Range("A3").Value, 2) & ".xlsx"

Is it possible to simply filter on just the CO21army & the Left(ThisWorkbook.Worksheets("Variables").Range("a8").Value, 3) part? something I would imagine looking like this

"=CO21army" & Left(ThisWorkbook.Worksheets("Variables").Range("a8").Value, 3)* &".xlsx"

any help is appreciated!

Jordan
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top