I have written a basic code in VB to filter out a specific text ("FIN") which I have to write in a .txt file and rename it using string from a cell in the same workbook but different sheet. Below is the code i prepared to filter out and it works but I am stuck at the saving and renaming part.
Sub SAVE()
Dim WS1 As Worksheet, WS2 As Worksheet
Dim Lastrow As Long
Set WS1 = Sheets("WORKING")
Set WS2 = Sheets("FINAL")
WS2.Cells.Delete
WS1.AutoFilter.ShowAllData
WS1.Range("B1:C50000").AutoFilter Field:=2, Criteria1:="<>FIN"
Lastrow = WS1.Cells(Rows.Count, "B").End(xlUp).Row
WS1.Range("B1:B" & Lastrow).SpecialCells(xlCellTypeVisible).Copy WS2.Range("A1")
Sheets("FINAL").Select
Range("A1:A & Lastrow").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy