Forum Discussion
TheSandman1290
Aug 28, 2022Copper Contributor
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...
- Aug 28, 2022
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
HansVogelaar
Aug 28, 2022MVP
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 SubTheSandman1290
Aug 28, 2022Copper Contributor
Bedankt Hans, dit doet exact wat ik wou!