+ Reply to Thread
Results 1 to 3 of 3

Insert A Row Macro

  1. #1
    Mark Williams
    Guest

    Insert A Row Macro

    Hi All,

    I am trying to write a macro that will insert a row above a blank row in a
    range I've named "PriorPTI". The blank row is the last row in a range that
    contains 12 rows. The range will grow as I insert more rows. I am not a
    programmer so any help will be greatly appreciated as I've spent two work
    days trying to figure this out (Yes: it is rocket science :-)).

    Regards,
    Mark

  2. #2
    Trevor Shuttleworth
    Guest

    Re: Insert A Row Macro

    Mark

    something like:

    Range("PriorPTI").Offset(-1, 0).Resize(1).EntireRow.Insert

    will insert 1 row in front of the range called PriorPTI

    Regards

    Trevor


    "Mark Williams" <Mark [email protected]> wrote in message
    news:[email protected]...
    > Hi All,
    >
    > I am trying to write a macro that will insert a row above a blank row in a
    > range I've named "PriorPTI". The blank row is the last row in a range that
    > contains 12 rows. The range will grow as I insert more rows. I am not a
    > programmer so any help will be greatly appreciated as I've spent two work
    > days trying to figure this out (Yes: it is rocket science :-)).
    >
    > Regards,
    > Mark




  3. #3
    Duke Carey
    Guest

    RE: Insert A Row Macro

    You're always going to want to add a row just above the last row in the named
    range, yes?

    DIM rng as Range
    Set rng = Range("PriorPTI")
    rng.Offset(rng.Rows.Count - 1, 0).Resize(1, 1).EntireRow.Insert xlDown


    "Mark Williams" wrote:

    > Hi All,
    >
    > I am trying to write a macro that will insert a row above a blank row in a
    > range I've named "PriorPTI". The blank row is the last row in a range that
    > contains 12 rows. The range will grow as I insert more rows. I am not a
    > programmer so any help will be greatly appreciated as I've spent two work
    > days trying to figure this out (Yes: it is rocket science :-)).
    >
    > Regards,
    > Mark


+ 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