I have my macro set up to grab a text file, and put it in excel. It is then sorting by column B. I need it to then search column B for a specific text, and ANY row that contains the selected text in column B, needs to be cut off the spreadsheet, and pasted onto another tab.

I am relatively new to Macros. I do have some experience editing macros, but this is the 1st one I am creating from scratch. I recorded this one, by just having excel follow my steps. Obviously, what happened there, is that the row numbers I cut and pasted, were hard coded into the Macro.

Any assistance would be appreciated! Thank you.

Here is the code that is in there now. I want to take out the hard coding of lines 88:89, and make it cut out ALL rows that contain ATTLG in coumn B.

Workbooks.OpenText Filename:= _
"U:\facs clients\at&t\text\attpay.txt", Origin:= _
xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 2), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15 _
, 1), Array(16, 1), Array(17, 1))
Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Find(What:="ATTLG", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
Sheets("Sheet1").Name = "ATTLG"