+ Reply to Thread
Results 1 to 2 of 2

Automatically Delete Text at the end of an imported report into Ex

  1. #1
    SITCFanTN
    Guest

    Automatically Delete Text at the end of an imported report into Ex

    I have a report that I import into Excel each day. At the bottom of the
    report is text I want to delete before running a macro. The number of rows
    in the report varies each day. I'd like to add code in my macro that
    automatically deletes that specific text at the end of the report or deletes
    the last 3 rows no matter how many rows are in the report. Can this be done
    with VBA code? Thank you

  2. #2
    Tom Ogilvy
    Guest

    Re: Automatically Delete Text at the end of an imported report into Ex

    Assume the text is in column A (adjust to the actual situation)

    Dim rng as Range
    set rng = Cells(rows.count,"A").End(xlup).Offset(-2,0).Resize(3)
    rng.entireRow.Delete

    --
    Regards,
    Tom Ogilvy

    "SITCFanTN" <[email protected]> wrote in message
    news:[email protected]...
    > I have a report that I import into Excel each day. At the bottom of the
    > report is text I want to delete before running a macro. The number of

    rows
    > in the report varies each day. I'd like to add code in my macro that
    > automatically deletes that specific text at the end of the report or

    deletes
    > the last 3 rows no matter how many rows are in the report. Can this be

    done
    > with VBA code? Thank you




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1