VBA macro to delete top lines of text in all cells in a column?

piecevcake

New Member
Joined
Mar 17, 2016
Messages
3
Hello,
I have a sheet of downloaded email messages. Can anyone help with a macro to delete lines above the message body, in all the cells in that column? I have been searching for a long time, found a macro which will work on one cell, but can't get it to work on all the cells in the column.

I also need to remove empty lines within those same cells (so there is just 1 line break between text)
Thank you :confused:

The text copy pasted from the cells:
Subject:

[Ticket#...

From:

[sender

Date:

10/8/16 4.00 a.m.

To:

[recipient



[need to keep this line to end of the cell]Hi there...
======================
The macro I have got so far:
Code:
Sub C___DRAFT_REMOVE_1ST_8_LINES_IN_1_SELECTED_CELL_SingleSelectionCellOnly()

'SELECT CELL 1ST

'TO DO: make it repeat down through a multiple cell selection!(COLUMN TO END OF SHEET)
    ary = Split(ActiveCell.Value, Chr(10))
    t = ""
    For I = 8 To UBound(ary)
        t = t & Chr(10) & ary(I)
    Next I

    If Len(t) > 1 Then
        t = Mid(t, 2)
    Else
        t = ""
    End If
    ActiveCell.Value = t
End Sub
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,216,583
Messages
6,131,557
Members
449,655
Latest member
Anil K Sonawane

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top