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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,223,250
Messages
6,171,036
Members
452,374
Latest member
keccles

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