Results 1 to 5 of 5

Thread: Macro to Delete Rows of Extraneous Data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Sep 2015
    Posts
    8
    Rep Power
    0

    Macro to Delete Rows of Extraneous Data

    I have a huge text file that I import on a monthly basis to Excel but need a macro that would delete rows except for those that has data between a cell that starts with "----" and ends with a "G/L Total:" in column A. Note that it's exactly 4 hyphens.

    Those two elements ("----" and "G/L Total:") are repeated at different rows in column A. Note that there are some blank cells in column A but not in between those two elements. If there are any blank cells in column A then the entire row should also be deleted.

    For example, there is extraneous rows of data from A1:A100 which includes blank rows, then A101 will start with "----" and have rows of data say until A120 where the last line will say "G/L Total:" Then in A121 there is extraneous data again until A180 then A181 will start with "----" and have rows of data say until A220, where the last line will say "G/L Total:" So the macro should delete the extraneous data (A1:A100 and A121:A180) including any rows where a cell in column A is empty and only display the data that is between "----" and "G/L Total:" (A101:A120 and A181:A220) for the entire spreadsheet.

    Thanks in advance.
    Last edited by showtyme; 09-10-2015 at 09:52 AM.

Similar Threads

  1. Replies: 3
    Last Post: 07-27-2014, 10:03 PM
  2. Replies: 8
    Last Post: 04-20-2014, 10:15 PM
  3. search for data and delete rows containing it
    By RickStewart in forum Excel Help
    Replies: 2
    Last Post: 02-24-2014, 09:12 PM
  4. Replies: 6
    Last Post: 08-14-2013, 04:25 PM
  5. Replies: 5
    Last Post: 07-11-2013, 07:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •