I'm trying to write a macro that will sort a work book that is generated by a system at work. I have attempted to chopshop some code together from other posts on this site with no success.
The goal is to search column A for any cells that contain either "IN" or "OUT" then move every thing to the right of these cells one cell to the right.
I have some code that works for the first output but it will only ever ready the first out put I know why it doesn't work but I don't know how to fix it.
Any help would be much appreciated, Thanks,
Sub Data_only()
'
' Reworks_Data_only Macro
'
' Keyboard Shortcut: Ctrl+k
'
Columns("J:AB").Select
Selection.ClearContents
Cells.Select
Cells.EntireColumn.AutoFit`enter code here`
' ^ Cuts out unused columns and autofits the rest
Columns("A:A").Select
Selection.Find(What:="in", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
' ^Searches Column A for "IN"
ActiveCell.Offset(, 1).Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
' ^Selects the found cell and shift the whole row to the right
End Sub
EDIT This is a mock up of the file im looking to change, there would normally be a few hundred batches and a lot more columns but it should be workable. batches mock up