+ Reply to Thread
Results 1 to 4 of 4

Macro to select 4 entire rows and then delete rows

  1. #1
    Scott Viney
    Guest

    Macro to select 4 entire rows and then delete rows

    Afternoon All,

    Ive never written a macro before. So excuse me if this is dead simple.

    With VBA how can I create a macro that when I select an entire row with the
    mouse then run the macro. It selects the next 3 entire rows below then,
    deletes these rows.

    Any help will be appreciated,
    Scott V



  2. #2
    JE McGimpsey
    Guest

    Re: Macro to select 4 entire rows and then delete rows

    One way:

    Public Sub Delete4Rows()
    Selection.Resize(4).EntireRow.Delete
    End Sub


    In article <[email protected]>,
    "Scott Viney" <[email protected]> wrote:

    > Afternoon All,
    >
    > Ive never written a macro before. So excuse me if this is dead simple.
    >
    > With VBA how can I create a macro that when I select an entire row with the
    > mouse then run the macro. It selects the next 3 entire rows below then,
    > deletes these rows.
    >
    > Any help will be appreciated,
    > Scott V


  3. #3
    Ron de Bruin
    Guest

    Re: Macro to select 4 entire rows and then delete rows

    Hi Scott

    This example will delete the activecell row and 3 rows below it

    Cells(ActiveCell.Row, 1).Resize(4, 1).EntireRow.Delete


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Scott Viney" <[email protected]> wrote in message news:[email protected]...
    > Afternoon All,
    >
    > Ive never written a macro before. So excuse me if this is dead simple.
    >
    > With VBA how can I create a macro that when I select an entire row with the mouse then run the macro. It selects the next 3
    > entire rows below then, deletes these rows.
    >
    > Any help will be appreciated,
    > Scott V
    >




  4. #4
    Scott Viney
    Guest

    Re: Macro to select 4 entire rows and then delete rows

    Thanks JE,

    If I wanted it to say start a specific entire row, then from there delete 4
    entire rows. Then move down a fixed number of rows then do the same thing
    till it run out of data how would I go about this.

    Scott
    "JE McGimpsey" <[email protected]> escribió en el mensaje
    news:[email protected]...
    > One way:
    >
    > Public Sub Delete4Rows()
    > Selection.Resize(4).EntireRow.Delete
    > End Sub
    >
    >
    > In article <[email protected]>,
    > "Scott Viney" <[email protected]> wrote:
    >
    >> Afternoon All,
    >>
    >> Ive never written a macro before. So excuse me if this is dead simple.
    >>
    >> With VBA how can I create a macro that when I select an entire row with
    >> the
    >> mouse then run the macro. It selects the next 3 entire rows below then,
    >> deletes these rows.
    >>
    >> Any help will be appreciated,
    >> Scott V




+ 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