I think this will kind of do what you want, although I'm not sure what the +5 lines bit refers to.
Sub macro_1()
MSC6 = "sdfaultsfkasdfMSC6asdofnasdklnsdMSC6aosdkfaultnfasldkcMSC6asdf"
first_MSC = Strings.InStr(1, MSC6, "MSC6")
last_MSC = 0
pos_count = Strings.Len(MSC6)
Do Until Not last_MSC = 0
pos_count = pos_count - 1
last_MSC = Strings.InStr(pos_count, MSC6, "MSC6")
Loop
Fault_loc = Strings.InStr(first_MSC, Strings.Left(MSC6, last_MSC), "fault")
copy_Data = Strings.Mid(MSC6, first_MSC, last_MSC - first_MSC + 4)
End Sub
Bookmarks