Forum Discussion

TheSandman1290's avatar
TheSandman1290
Copper Contributor
Aug 28, 2022
Solved

remove first 13 lines from multiline cells

Hi everyone,   this is my first post here!   I am looking for a way to remove the first 13 lines of a column (B) that is filled with multi-line cells Usually my google-fu is strong, but for this...
  • HansVogelaar's avatar
    Aug 28, 2022

    TheSandman1290 

    Sub RemoveFirst13Lines()
        Dim m As Long
        Application.ScreenUpdating = False
        m = Range("B" & Rows.Count).End(xlUp).Row
        Range("C1").EntireColumn.Insert
        Range("C1:C" & m).Formula = _
            "=MID(B1,FIND(CHAR(164),SUBSTITUTE(B1,CHAR(10),CHAR(164),13))+1,10000)"
        Range("B1:B" & m).Value = Range("C1:C" & m).Value
        Range("C1").EntireColumn.Delete
        Application.ScreenUpdating = True
    End Sub