Mark F
Well-known Member
- Joined
- Jun 7, 2002
- Messages
- 513
- Office Version
- 365
- Platform
- Windows
Hi, I'm looking to filter to show all rows where the left seven characters in cells in column Bare "Message"
Below is the code I have, but it is not working as I hope.
Thanks for any help
Mark
Below is the code I have, but it is not working as I hope.
Thanks for any help
Mark
VBA Code:
Sub filter()
ActiveSheet.ShowAllData
lastRow = Cells(Rows.Count, "a").End(xlUp).Row
ActiveSheet.Range("A:U").AutoFilter Field:=2, Criteria1:=Left(Cells(b2).Value, 7) = "Message", Operator:= _
xlFilterValues
End Sub